CinemachineFramingTransposer In The Inspector?

Hello All,

I have serialized a field in the inspector for a CinemachineFramingTransposer. But when I try and drag the Virtual Camera into the field, it’s not accepted. Is there anyway I can reference the camera’s FramingTransposer in the inspector? I am trying to avoid using GetComponent.

Thanks for taking the time!

Unfortunately no, not with CM 2.x.
You can do it with CM 3.0, but that isn’t released yet.

You can make the field a VirtualCamera field, do a GetCinemachineComponent() at startup, and cache the result.

1 Like

Ah, I see. Well, at least its possible in CM 3.0. I’m excited for the release.
Thanks for the reply!

Edit: Spoke a bit too soon. Still not quite understanding something.
Does the VirtualCamera require specific settings to get the framing transposer component?

Here’s what the VirtualCamera looks like in the inspector:

Then I’m trying to access the FramingTransposer this way:

myVirtualCam.GetComponent<CinemachineFramingTransposer>().m_TrackedObjectOffset = new Vector3(1, 1, 1);

My problem is that the CinemachineFramingTransposer is always null. :face_with_spiral_eyes:

You have to use vcam.GetCinemachineComponent() because the component is not directly on the vcam GameObject, it’s buried deeper.

1 Like