I decided to transition from the default camera component to Cinemachine for my first-person controller, but unfortunately I ran into some issues along the way. There’s not much information about it about using Cinemachine in FPS’s, so I couldn’t find much about it.
The problem is that for some reason, the movement controls of my controller are reversed and blocked on certain axes, making movement almost impossible. This is my first time using Cinemachine, so maybe it’s just something I did wrong from the beginning (although according to the tutorials I saw, I shouldn’t be facing this problem).
Some context:
The virtual camera has the player’s head (a gameobject controlling headbobbing animations, and with the main camera has its child) attached to the Follow field, and the LookAt field has the player itself.
Body is set to Hard To Lock Target and Aim to POV. The virtual camera is also using an Input Provider so it can receive values from the new input system.
Virtual Camera it’s also child of Head.
I’m working on Unity 2019.4.29
Any ideas? Thanks in advance
EDIT: Found something interesting. Basically, the body of the player is not rotating with the camera as it should. Since every other video about FPS with Cinemachine works, it seems to be a bug.
Try controlling your player’s transform with your inputs directly.
Then attach a ThirdpersonFollow vcam to your player. See the Aiming Rig example scene - change the shoulder offset, arm length, and aiming distance to 0. You will get a FPS camera this way.
You can get our example scenes from the Package manager:
You would have to show your vcam inspector. From your description I can make this guess: given that the vcam is a child of Head, you can put Do Nothing in the Body section, and put both LookAt and Follow targets to blank. Then your POV should work as a camera. Of course, you are just moving the camera, not the head. A better approach is to use 3rdPerson CM vcam as @gaborkb suggests.
Ohh, I see, so that means that I still need to do some scripting to get POV work as I expect? right?
Sorry, I saw this post and while I notice that a lot of people was running into issues, some tutorials I saw later weren’t having those (so they didn’t have to do any extra scripting), so that’s probably where my confusion began.
It looks like it works. This comment makes an interesting point in relation to the problem I was presenting.
The POV Cam Mode doesn’t work out of the box as it seems to be presented, or at least, it’s not clear on what it actually does. I think that should be revisited to avoid future confusion.