- Home /
Simple character rotation
Hi there, Im beginning using Unity. I would like to assign a rotation to my character each time I press mouse right click. How can I script this simple action and how can I assign an input ?
Sorry for that newbie question but I guess if I succeed, i will able to continue my learinig.
Thanx
Comment
Answer by Berenger · Feb 21, 2012 at 10:44 PM
That's the right place to ask question, even the simple one.
You can know if an input is used with Input functions, which return a bool usually it goes like :
if( Input.GetKeyDown("space") ) // ...
To rotate your object, the simplest way is to use transform.Rotate(x, y, z);
Your answer
Follow this Question
Related Questions
Rotating a character 4 Answers
Character Glitches 1 Answer
Character MoveLook rotation locked? 1 Answer
Rotate object after swipe according to swipe direction 0 Answers