public void HandleWheel(InputBase input) { if (wheelCol) { //out stores output at this variable wheelCol.GetWorldPose(out worldPos, out worldRot); if (wheelGraphic) { wheelGraphic.rotation = worldRot; wheelGraphic.position = worldPos; } /* * if (isBraking) { * if (input.Brake > 0.1f) { * finalBrakeForce = Mathf.Lerp(finalBrakeForce, input.Brake * brakePower, Time.deltaTime); * wheelCol.brakeTorque = finalBrakeForce; * } * else { * wheelCol.brakeTorque = 0f; * } * } * * if (isSteering) { * finalSteerAngle = Mathf.Lerp(finalSteerAngle, -input.Yaw * steerAngle, Time.deltaTime * steerSmoothSpeed); * wheelCol.steerAngle = finalSteerAngle; * }*/ } }
private void OnEnable() { targetInput = (InputBase)target; }