3rd Person Camera Assistance Request

Howdy guys, got a question if someone has any good advice for this. I’m trying to make a 3rd person game with very little unity or coding experience, and I’m not having a lot of luck with the camera that I’m wanting. While I’ve found some old tutorials that match what I want, the scripts or assets that they refer to are all outdated and make errors or just plain no longer exist.

My end goal objective is to make a 3rd person camera where the player controls the camera with the mouse, can look up and down with it, the A and D keys make the player strafe left or right, maybe scroll in or out to affect zoom, but the main thing is that when moving the camera left or right the player turns with it, keeping the player character facing forward. The same type of camera system used in skyrim or 3rd person minecraft, here’s a lil video of it if you’re unfamiliar.

If anyone knows a tutorial or something that they could point me to, I’m slowly headdesking my way through this game making stuff, but I’m not seeming to have much luck with this one. Thanks in advance anyone reading.

Have a look at the FreeLookCharacter scene in CinemachineExamples. It’s not exactly what you want (A/D turns the character instead of strafe), but it should be a good starting point.

1 Like

Thank you very much for the response c:
Googling what you suggested I went through these tutorials (didn’t see one called FreeLookCharacter, whenever I searched it brought up free look camera tutorials. One of these is from unity, and the other one is a more in depth one, if I missed an obvious one somewhere then whoops >.<):

https://www.youtube.com/watch?v=J1GgvDfmIo0

https://www.youtube.com/watch?v=X33t13gOBFw

Going through it was part of what I’m looking for, but I want the camera to be positioned behind the player, and left/right looking turns the player as well as the camera. Controlling both a free moving player as well as a free moving camera is a bit of a challenge, or at least it is for me.

As for strafing itself I might be able to find separate guides for that function independently, but the camera movement being tied to the player’s left/right turning is completely evading me. If you’ve got any other ideas or suggestions then please let me know, if not then thank you for the starting advice ^^

The FreeLookCharacter scene in CinemachineExamples is not a tutorial, it’s an example scene shipped with Cinemachine. You find it this way:

4728047--447737--upload_2019-7-9_8-50-33.png

4728047--447743--upload_2019-7-9_8-52-22.png

You can have a look at the character controller script:

4728047--447749--upload_2019-7-9_8-56-31.png

Essentially, the strategy is that the character controller script animates the character (not the camera) based on the input controls, and the camera is a FreeLook set to follow the character. The character controller script checks the camera orientation when interpreting the meaning of left/right/forward, so that these directions can be relative to the camera.

1 Like

Oh nice, that is actually a lot like what I’m going for. The directions felt inverted one way, but I think I can fix that by putting a “-” sign in front of one of the axis lines somewhere if I remember what I read in some of the tutorials right. After that I can look up a separate tutorial somewhere for turning the A and D keys into strafing buttons, so hopefully I can get this sorted out from here. Thank you very much for all of your help, I really appreciate it.

1 Like