CinemachineOffset + Cinemachine Collider?

Hello, I’m current making a photo mode for my game, and I want to use the Cinemachine Offset to make the player pan the camera around.

My game cam is a FreeLook camera, and when I switch to photo mode, I switch to a Freelook with similar parameters, and adjust values through photo mode inputs (Fov, dutch, …).

I tried using a Cinemachine Offset component for panning, as its great way to override all the aim/body composers calculations, but it doesn’t seems to work with the Collider component, meaning I can go through walls, ground, etc

Would there be a way to achieve the intended effect? All suggestions are welcome

Note: I initially wanted to use the Unity Photo mode packages, but unfortunately, it turned out to be too overkill for my need, and not that easy to integrate into an existing project.

Unity 2020.3.1 / Cinemachine 2.6.10

Yes, CameraOffset and Collider do not play well together.

When photo mode is entered, I would do it like this:

  • Create an empty GameObject to serve as Follow target. Initialize its position and rotation to match the main camera.

  • Put a controller script on the game object, allowing user to move and rotate it according to your desired control scheme.

  • Activate a new vcam configured this way:

  • Follow target: Your new follow target object

  • Body: HardLockToTarget,

  • Aim: SameAsFollowTarget

1 Like