- Home /
How do I rotate a character with joystick input in an isometric view?
How do I rotate a character with joystick input in an isometric view?
I am currently working on an isometric shooter in my spare time for friends and I to play between classes. I think it could turn out pretty cool. I have keyboard input to move the character around and rotation following the mouse position so the player is always looking at the mouse. What I want to do now is add joystick movement and rotation. I have the movement down, but I can't seem to get the player to rotate in the direction the thumbstick is pointed. Think "Alien Infestation" where the player looks in the direction the joystick is pointing. Thanks in advance!
Answer by RLin · Aug 10, 2015 at 08:27 PM
Use input.getaxis for the two joystick axis(up and down, left and right) and then normalize the two values. Use that to set your character's rotation.
Thanks for the answer. So store the normalized values in variables then use the Rotate() function or should I set rotation += X? Not sure how to proceed.