extremumValue 和 asymptoteValue 值(默认值 1)的乘数。
更改摩擦的硬度。将此值设为 0 将完全禁用车轮的所有摩擦。
通常,修改 stiffness
以模拟各种地面材料(例如,在草地上行驶时降低硬度)。其他资源:WheelCollider.GetGroundHit。
using UnityEngine; using System.Collections;
public class ExampleClass : MonoBehaviour { public WheelCollider wheel;
void Start() { wheel = GetComponent<WheelCollider>(); }
// When attached to the WheelCollider, modifies tire friction based on // static friction of the ground material. void FixedUpdate() { WheelHit hit; if (wheel.GetGroundHit(out hit)) { WheelFrictionCurve fFriction = wheel.forwardFriction; fFriction.stiffness = hit.collider.material.staticFriction; wheel.forwardFriction = fFriction; WheelFrictionCurve sFriction = wheel.sidewaysFriction; sFriction.stiffness = hit.collider.material.staticFriction; wheel.sidewaysFriction = sFriction; } } }