Car go wroom (bilen hopper mindre på jorden)

This commit is contained in:
magn9775
2024-03-25 15:56:53 +01:00
parent 71abc36667
commit dec65e0cd0
10 changed files with 1605 additions and 23 deletions

View File

@@ -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
}
}