- Home /
First person controller movement direction incorrect
I've googled it, but i can't seem to find the problem.
Whenever I start the game, and use the controller, EDIT: the character appears to move relative to the x/y/z axis rather than where i'm looking/camera is facing. anyone got a solution?
(I'm using Unity's first person controller btw)
I FOUND THE PROBLEM lol it turns out i had a mouse look script on the camera itself, and the character, i just removed the one on the camera and now it works fine lol thx for all ur help guys
Are you using a Smooth follow or Smooth Look At script on the Camera object?
Answer by RetepTrun · Jan 29, 2015 at 01:15 AM
Maybe you forgot to add a mouselook script to the controller for rotation on left right. Camera should only have up/dwn.
The Camera is just fine, the character is moving in the wrong direction.
I had the same problem. In my case, it was caused by my custom $$anonymous$$ouseLook script: I only rotated the camera's anchor (the "head", so to speak) around it's y axis, wheras it should have been the character itself. If you look at your selected CharacterController's Capsule from scene view, does it rotate around it's y axis when moving the mouse left and right? If not, then you know what is causing your problem :)
Did you see if the buttons were set right in the input settings?
Answer by mavii_ege · Jan 30, 2015 at 03:29 AM
you need to add mouselook script to character and camera
Answer by JCalwaysbeatsErick · Jan 30, 2015 at 03:29 AM
You might wanna check your local or global camera settings.or reset the coordinates on the main camera axis located in the inspector.
Answer by awplays49 · Jan 30, 2015 at 03:29 AM
Use
transform.forward
And not
Vector3.forward
@awplays49 in which script?
if it helps, the scripts being used are:
$$anonymous$$ouseLook
Character$$anonymous$$otor
FPSInputController
And my custom $$anonymous$$ouse lock script, but all it does is use the Screen.lockCursor function
@Gummybug12 Please dont post comments as Answers. Find the relevant Add New Comment button under the comment or answer you wish to reply to.