- Home /
How make front wheel bike turn left or right?
Hi,
I have looked everywhere, also tried modifying car tutorials to try get a 2 wheel bike setup, I have a bike setup using gameobjects, wheel colliders, hinges.....sort of all hangs together ok..but I cannot get the front wheel to turn on the Y axis say if I press A or D keys... no matter what scripting I try..
Has anyone got some pointers for me?
Kim
What do you have by now? Please show some code and explain your setup in more detail.
Answer by khos85 · Nov 30, 2013 at 05:58 PM
I think I have it working now... I was rotating the wheel too much..
Code attached to front wheel now looks like:
if (isddown==1){transform.Rotate(0,20,0);return;}
if (isadown==1){transform.Rotate(0,-20,0);return;}
and this works much better :)
Initially I had: if (isddown==1){transform.Rotate(0,270,0);return;} if (isadown==1){transform.Rotate(0,-270,0);return;}
So that is rotating it way too much. Not sure why I did that!
It is not a very smooth rotation either :(
Just marking as answered to end this one, unless others have any comments they are of course very welcome
Your answer
![](https://koobas.hobune.stream/wayback/20220613123118im_/https://answers.unity.com/themes/thub/images/avi.jpg)
Follow this Question
Related Questions
How to make wheels turn more? 0 Answers
Rotate the bike,s wheels to move the bike. 1 Answer
Bike Control 0 Answers
Bike wheel rotation on x-axis and steering on y-axis 1 Answer
Best way to make wheels freely turn / swivel? (Like a shopping cart) 2 Answers