How to make object (player) rotate with camera


I am trying to make a FPS

I have managed to get the camera to move with the mouse but I cant get the character to rotate with the camera and mouse

So basically when I play it the camera view moves with the mouse but the character model doesn’t meaning that if I go to move forward I dont move in the direction the camera is pointing at.

How would I fix this

Many thanks :slight_smile:

You need to rotate your capsule using the controller’s X axis (in order to rotate both the capsule and the camera as its child), and only rotate the camera using the controller’s Y axis (so that only the camera looks upwards, but the capsule stays upright).

In other words, your First Person Controller’s MouseLook script’s “Axes” need to be set to “MouseX”, and your MainCamera’s MouseLook script’s to “MouseY”.

Do it like in the First Person Controller prefab - it has two MouseLook scripts: one is attached to the character and has Axes set to Mouse X, while the other is attached to the camera and has Axes = Mouse Y - this way, Mouse X rotates the character and the camera in the horizontal plane, while Mouse Y only rotates de camera in the vertical plane (look up/down)