Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- void Update()
- {
- // Main Thrust
- thrust = 0.0f;
- float acceleration = Input.GetAxis("Vertical");
- if (acceleration > deadZone)
- thrust = acceleration * forwardAcceleration;
- else if (acceleration < -deadZone)
- thrust = acceleration * reverseAcceleration;
- // Turning
- turnValue = 0.0f;
- float turnAxis = Input.GetAxis("Horizontal");
- if (Mathf.Abs(turnAxis) > deadZone)
- turnValue = turnAxis;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement