Switching between free look cam and a cinemachine timeline track

I’ve setup a Cinemachine timeline track with several CM vcam shot clips. I also have a Cinemachine free look cam in the hierarchy window. At the moment I’m setting the Cinemachine.Solo property to the free look cam to have this override what the timeline is doing at runtime via script when the player hits a button.

However I’ve run into a curious problem in that in solo mode the free cam x-axis is not responding to Mouse X input or Horizontal input for that matter whereas the y-axis will respond to Mouse Y correctly. If I mute the cinemachine track this problem doesn’t occur. Is this something that can be fixed or is there a workaround?

Fabulous tool by the way. It’s saved me weeks of work.

Kam.

After some digging I have a workaround. Somebody else might find this useful.

I create a standard animation track linked to an empty game object. For this whole process I will end up creating several clips for the track. A new clip is required everytime there’s a camera cut. During recording, each key frame is positioned at the start/end of a blend or at a vcam cut. I copy the transform component properties directly from the main camera for each new key frame. I then assign the main camera to the new track (camera requires an animator component). I then delete the original cinemachine track so it can no longer interfere with the cinemachine free cam.

To switch back and forth between the free look cam or animated camera I disable the cinemachine brain and enable the animator component on the main camera or vice versa in script at runtime.

Hardly an optimal workflow but it works. What would be better is to have an option in the Cinemachine brain to enable/disable Cinemachine tracks. Another useful feature would be an option to switch between Cinemachine tracks.

Kam.

Cinemachine tracks in the Timeline work like a stack: the ones further down override the ones higher up. You could probably get the functionality you want by creating a CM timeline track with only a FreeLook clip in it, and enabling it whenever you want the FreeLook to override the other CM tracks.

Sounds like you’re saying create 2 cinemachine tracks and enable/disable them at runtime? How would I do this with the Playables API? The timeline isn’t available at runtime so I can’t just mute the track like I could in the edtior. Some sample code would be awesome in making this clear.

Thanks!

Kam.

You could create another timeline and enable/disable that.

I tried it out and it works great! I create 2 empty game objects, each is assigned it’s own Playable Director component and a unique timeline. One timeline has a free cam cinemachine shot clip and the other timeline has a vcam cinemachine shot clip. I enable/disable the Playable Director components to toggle between the timelines at run time.

Cheers!

Kam.

2 Likes