Car go wroom (bilen hopper mindre på jorden)
This commit is contained in:
@@ -14,14 +14,12 @@ public class CarController : MonoBehaviour
|
||||
{
|
||||
// Motor input
|
||||
float motorInput = Input.GetAxis("Vertical");
|
||||
frontLeftWheel.motorTorque = motorInput * motorForce;
|
||||
frontRightWheel.motorTorque = motorInput * motorForce;
|
||||
rearLeftWheel.motorTorque = motorInput * motorForce;
|
||||
rearRightWheel.motorTorque = motorInput * motorForce;
|
||||
|
||||
// Steering input
|
||||
float steeringInput = Input.GetAxis("Horizontal");
|
||||
frontLeftWheel.steerAngle = steeringInput * steeringAngle;
|
||||
frontRightWheel.steerAngle = steeringInput * steeringAngle;
|
||||
|
||||
// Move camera
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user