- Home /
Moving a character
Hi there, I'm just wondering how to move a character with a third person view and controlling the camera with the mouse. That is when I press right arrow (-->) key,the character should move right from its current facing direction and the current facing direction must be controlled by the mouse.
The character should not always move towards a direction when pressing a movement key.
I have explained my idea in the image I have attached to this question.
Answer by DynamicPrgm · Jan 25, 2014 at 07:00 PM
Well, if the first key is pressed, then you should set the rotation to what it should be depending on the key pressed.
if(Input.GetKeyDown(KeyCode.D)) {
transform.rotation = 90;
//Move forward etc
}
Your answer
Follow this Question
Related Questions
The name 'Joystick' does not denote a valid type ('not found') 2 Answers
Unity 4.3.4 completely freezes with third person script 0 Answers
How to import the object from server to unity 2 Answers
Footstep sounds not coming up when walking? (MOBILE) 3 Answers
Can someone help me fix my Javascript for Flickering Light? 6 Answers