Why is on some cinemachine shots the PropertyName exposed and on others it isn't?

Hi,

I’m binding Virtual Cameras during runtime. It works great on most cases, but sometimes when adding a shot, it doesn’t have field for the property name. The images show one of each cases:

9759942--1397772--Screenshot from 2024-04-09 17-45-10.png

What I refer to is the field containing “KoCamera” on the bottom.

9759942--1397769--Screenshot from 2024-04-09 17-45-22.png

Here it is missing.

That looks like some kind of weird inspector glitch.
What version of Unity?
What version of CM?
What is this KoCamera field?
Please show the inspector for the KoCamera object.

1 Like

Hi, thanks for the swift reply.

Cinemachine 2.9.5
Unity 2022.3.19f1

According to the yaml file and the script I use, the KoCamera field is called ExposedName.

The difference in the yaml file is the following on:

I create a Cinemachine track with different shots with unassigned Virtual cameras. I then assign the cameras during runtime using
playableDirector.SetReferenceValue and the exposedName. It usually works great, but sometimes the exposedName field is hidden.

I also think to remember that I always set the name of the CinemachineShot and not the exposedName…

You should show the code where you set the vcam reference. I would expect to see something like this:

var shot = clip.asset as CinemachineShot;
shot.VirtualCamera.exposedName = node.name;
playableDirector.SetReferenceValue(shot.VirtualCamera.exposedName, vcam);

I’m using a string as exposedName:

void BindVirtualCameras(CameraData cameraData)
        {
            playableDirector.SetReferenceValue("FPSCamera", cameraData.fpsCamera);
            playableDirector.SetReferenceValue("HeadCamera", cameraData.headCamera);
            playableDirector.SetReferenceValue("KoCamera", cameraData.koCamera);
        }
public class CameraData
    {
        public Camera camera;

        public CinemachineBrain cinemachineBrain;

        public CinemachineBrain cinemachineBrainOverlay;

        public CinemachineVirtualCamera fpsCamera;

        public CinemachineVirtualCamera headCamera;

        public CinemachineVirtualCamera koCamera;

        public GameObject screenFade;
    }

This worked before, and it works in a timeline that I created after the one that doesn’t work, but I can’t reproduce it, so I can’t pinpoint it.

Ok, when setting the exposedName in the yaml file as a string, the text field for it appears, so it is correct behaviour by the editor as it won’t display a GUID.

I will try tomorrow to set the VCams the way you suggested, so it won’t be as hacky.

Thank you!

1 Like

It works perfectly, thank you again.

1 Like