Cinemachine Virtual Camera Transition between objects while keeping dead zone

  • 3d game
  • 2 game objects: A and B. (both spawned on runtime)

I want to get a smooth transition from object A to B, but only if, the object B is outside vcam’s dead zone.
Vcam should look at the object with static rotation. (only the camera position should change)

I assume that I have to use:

  • Follow property - because it only affects vcam transform
  • Framing Transposer - to use dead zones in body component

I’ve tried spawning new vcam with B and disabled the first vcam - this gives smooth transition between cameras, but it does it always, even if A and B are inside dead zones of 1st and 2nd vcam.

How can I achieve smooth camera transition between 2 game objects only if the new one is outside the dead zone of previous vcam?

I know that I can do it by moving object followed by vcam from A to B and this should work with dead zones, but I’m looking for cleaner solution if it’s possible

CM doesn’t give you a notification when things go in and out of dead zones. You can accomplish what you’re looking for by polling the position of B relative to the camera (use the main camera, the one with the Brain) and manually calculating whether the angle between CameraPosToB and CameraForward is sufficiently large, and activating the second vcam when it is.

1 Like