- Home /
how to add tilt steering to car?
i have tried for 2 hours and i can't figure out how to add tilt steering to a car game I've been messing with. i have a gui texture for gas and break. if i can't get tilt working i 'll just use joystick if anyone can help? i'm trying it on android and iOS
Answer by ZANTcr · Jul 20, 2014 at 08:36 PM
Hi I did a 2D Vehicle Control for the asset store, and maybe the way I did the tilt could work for you.
What I did is add torque to the rigidbody, if you have a 3d project the function is like this rigidbody.AddTorque(new Vector3(0,0,force * userInput ));{
If you have a 2D Project is like this rigidbody2D.AddTorque(force)
Answer by Arycama · Nov 16, 2014 at 05:34 PM
Do you mean you want the car to turn left/right depending on whether you rotate your device left/right? If so, you can use Input.acceleration.x, for example:
wheelcollider.steeringAngle = Input.acceleration.x;
Your answer
Follow this Question
Related Questions
vehicle decceleration and angle reseting 1 Answer
How to make a steering wheel that rotates when wheels do? 0 Answers
Simple steering wheel rotation in a car 1 Answer
Connecting steering wheel to front wheels 0 Answers
Car steering 1 Answer