Hard Lock to Target + Cinemachine Collider = buggy camera collision

I have a Dark Souls like lock on system working nicely using a Hard Lock to Target camera- I would now like to get camera collision working with it so I added a Cinemachine Collider- no matter what settings I use I cannot seem to get any consistent/non buggy camera collision out of it-

The camera either pops through to the other side of the walls or randomly goes underneath the floor- its not usable.

I have camera collision working perfectly with the 3rd person follow cam and its built in camera collision options but when selecting Hard Lock to Target there’s no built in options so I’m using the Cinemachine Collider component.

I know my layers and colliders are setup properly as the 3rd person follow cam’s collision works perfectly.

I searched through the threads here and tried all the different settings but I can’t get any decent behavior out of the Hard Lock to Target camera. Any ideas? Thank you

CinemachineCollider uses the offset between camera position and LookAt target as a hint when choosing how to de-collide the camera. If you’ve hard-locked the camera position to the target, then CmCollider no longer knows how to de-collide consistently.

How to fix this? I can think of these options:

  • Create a dummy LookAt target object somewhere in front of your player.
  • Write your own decollider extension that uses a different algorithm.
  • Attach a Collider to the target you’ve hard-locked to, then the camera will automatically not penetrate objects because its target doesn’t.

Hey thanks for the reply- I switched the lock on camera to a 3rd person follow type as well- it doesn’t give the exact behavior I want but the collisions work nicely- I’ll try out these solutions with hard lock when I get a chance- thank you.

3rdPersonFollow is a good alternative because it has its own built-in collision resolution.

Yes the built in collision resolution is very nice- any tips on getting 3rd person follow to act more like Hard Lock to target? Thank you.

You mean apart from setting all the rig offsets to zero? What is the specific difference in behaviour that you want to eliminate?