Here’s my settings for a CinemachineCollider added to the virtual camera.
I made all the walls on an Obstacle layer. This causes the setup to react if there is an obstacle between the camera and the selected unit.
The Preserve Camera Distance strategy makes the camera move up to avoid the wall when it’s in the way. The other option is Preserve Camera height, which will try to move the camera THROUGH the wall until it’s not in the way. This isn’t always wanted, especially if the character is right up against the wall on the other side.
