Cinemachine Dynamic Distance Based on Collision Distance

So i’m wondering if the following is done with a cinemachine collider?

I’m looking for a solution, without having to use a bunch of carefully placed cameras, where if my third person character is in tight spaces, the camera moves closer to the player. If the player is in a wider open space, it moves farther away.

The game A Hat in Time seems to do this but they could just be using a bunch of cameras…

So the camera detects the collisions around it and moves in/out accordingly. A combination of camera radius and Min distance from target perhaps?

What setting on the Collider extension would affect this behaviour?

Thanks!

Yes, Camera Radius is a good start. Min Distance From Target specifies a distance such that, if the obstacle is closer to the target than that, the obstacle is ignored. This is primarily to get the camera to ignore obstacles that are part of the character itself.

However, this approach will only work if the camera is already in the tight space along with the character. If the camera is merely looking at the character in a tight space from a distance, nothing will happen. In that case you can use trigger zones and alternate cameras.

Ok great thanks! One issue I’m having though with camera switching is it seems that when I switch back to my player camera, the camera’s position moves for a bit before it settles back to it’s position, so it’s a bit jarring.

For example I have an orbital camera for my third person player, on a time slow down moment when he’s defeats an enemy I switch cameras and zoom in, then switch back to the orbital. The transition back to my orbital makes the rotation all wonky for a couple seconds. I have a cam transition set up on the brain but i’m not sure what’s causing this. It’s like the player camera while inactive has been following the zoom in cameras behaviour…

Is there a way to keep the cameras steady while it’s transitioning?

Thanks again for your help!

Can you show a video of the problem? There might be something you can do with Blend Hints.

Thanks! I think making a video would be challenging but blend hints seemed to be a lot better!

My question though now leads to this:

I have a CU virtual cam that gets triggered when you collect something. Like a victory CU for a few seconds. The issue Im having is how do I get the camera to always face the front of the player when the CU camera is activated?

I was trying a Hard lock to target and an Aim Hard Look At, is that correct? Still seems to want to look at the character from the side view when it does the switch, instead of front facing, even with the Blend Hints…

Its strange because at runtime, with the CU camera in solo mode, it’s always facing the player. It’s just when I transition from the Player cam to this CU camera, it switches the CU camera’s view to the side of the player.

In the CU camera, use a Transposer with LockToTarget binding mode. Set the camera offset to be in front of the player. Use a Composer or a HardLookAt in Aim. That will ensure that the camera is always positioned in front of the character, and looking at it.

Blend hints influence how one camera will blend to another, not where the camera gets positioned.

That worked…thank you so much!