Recommendation for Implementing my Camera System (Survival Horror)

Hello, so I’m still pretty new to Cinemachine and don’t really have a grasp yet on what avenue would be best for setting my camera up.
Linked gif, since embedding does not work (sorry)
https://cdn.discordapp.com/attachments/371740260607983616/1221885134320697495/2024-03-25_11.12.15.gif?ex=66143435&is=6601bf35&hm=9bfb2ce7295ef7c12e1c7b95a3ca6f0e43d3759a398c410b42158570a2ea447b&

I’ve made a janky little setup here by literally just setting the player as the main camera’s parent and positioning said camera behind him.
Of course, this is lightyears away from any remote semblance of ideal (the camera will clip right through the walls ffs lol), but it makes for an ok placeholder to show what I’m going for.)

These are the general stipulations for what I have in mind:

Anyway, I was curious to see any discussion and/or discourse regarding how a camera system like this can/should be setup.
(Also, the more you explain the details of how to do something technically in Cinemachine, the better since I’m still pretty new to it’s functions.)

Working on getting the gifs to show. idk why they’re not.

Edit: Fixed. I had to link the gifs instead of embed.

What would you like the camera to do in this case?

The best fix I can think of is for the camera to be above his head or right on his shoulder, and tilt slightly downward.

I’m not sure what seasoned and/or AAA developers did to fix this with similar camera setups for games like RE4, Dreadout, or Siren Blood Curse. I don’t own copies of them anymore, so I can’t test them out myself at the moment.

Well, there’s nothing out-of-the box in CM to do that for you. You’ll have to make a custom extension to detect that condition and move the camera appropriately.

Apart from that, it’s fairly straightforward to set up:

Basic vcam with Transposer and composer, LookAt and Follow set to the player.

Transposer: use Lock to Target with World Up binding mode, set the offset to be behind the player. Add some damping - both for rotation and position, to get the desired lag.

The Composer will be set to look at the player’s head, and that will be maintained regardless of where the camera is positioned. You can add some damping there too, according to taste.

Add a CinemachineCollider extension to keep the camera from going through the walls. By default, the camera will get squeezed between the walls and the player when the player backs into a wall, and then your custom extension would kick in to push the camera up overhead.

EDIT: an alternative to making a custom extension would be to make a second vcam, following the player from an overhead position. You would have a custom script that detects when the regular vcam camera is getting squeezed between the character and the wall, and activate the overhead vcam when that is happening. CM will perform a smooth blend between the two. When the player moves away from the wall, deactivate the overhead vcam and CM will blend back.