Version: 2022.2
public float forwardSlip ;

描述

滚动方向的轮胎打滑。加速打滑为负数,制动打滑为正数。

using UnityEngine;

public class Example : MonoBehaviour { // Prints "braking slip!" when tire slips badly. void FixedUpdate() { WheelHit hit = new WheelHit(); WheelCollider wheel = GetComponent<WheelCollider>(); if (wheel.GetGroundHit(out hit)) { if (hit.forwardSlip > 0.5) print("braking slip!"); } } }