This commit is contained in:
magn9775
2024-04-26 09:19:27 +02:00
parent 4740a04736
commit d491c6dee7
21 changed files with 2165 additions and 23268 deletions

View File

@@ -77,18 +77,19 @@ public class PlayerController : MonoBehaviour
if (isBraking)
{
wheel.WheelCollider.motorTorque = 0;
wheel.WheelCollider.brakeTorque = Mathf.Abs(vInput) * brakeTorque;
//wheel.WheelCollider.motorTorque = 0;
}
if (isAccelerating)
{
// Apply torque to Wheel colliders that have "Motorized" enabled
wheel.WheelCollider.brakeTorque = 0;
if (wheel.motorized)
{
wheel.WheelCollider.motorTorque = vInput * currentMotorTorque;
}
wheel.WheelCollider.brakeTorque = 0;
}