i've got a problem...
i made a car that can move and rotate. but i want the car only to rotate if you press either up or down... if you don't press up or down, or w and s, the car shouldnt rotate... i haven't been able to write a code like thus... (i already tried some if input axis vertical, then car.rotation = ,.....) but then i couldn't rotate at all anymore.
how would a script like this look?
thanks in advance for your help.
Up to 2 attachments (including images) can be used with a maximum of 524.3 kB each and 1.0 MB total.
The best place to ask and answer questions about development with Unity.
To help users navigate the site we have posted a site navigation guide.
If you are a new user to Unity Answers, check out our FAQ for more information.
Make sure to check out our Knowledge Base for commonly asked Unity questions.
If you are a moderator, see our Moderator Guidelines page.
We are making improvements to UA, see the list of changes.
Answers and Comments
3 People are following this question.
Need help with the movement+rotation C# script
Determining the rotation of an object based on its upcoming position?
how do i set the eular angles of a parent object to the same thing as the child object, without changing the rotation of the child object.
Flip over an object (smooth transition)
Object leaning with 2D movement