Search Unity

  1. Check out the Unite LA keynote for updates on the Visual Effect Editor, the FPS Sample, ECS, Unity for Film and more! Watch it now!
    Dismiss Notice
  2. The Unity Pro & Visual Studio Professional Bundle gives you the tools you need to develop faster & collaborate more efficiently. Learn more.
    Dismiss Notice
  3. Improved Prefab workflow (includes Nested Prefabs!), 2D isometric Tilemap and more! Get the 2018.3 Beta now.
    Dismiss Notice
  4. Improve your Unity skills with a certified instructor in a private, interactive classroom. Watch the overview now.
    Dismiss Notice
  5. Want to see the most recent patch releases? Take a peek at the patch release page.
    Dismiss Notice

Switching between free look cam and a cinemachine timeline track

Discussion in 'Cinemachine' started by kyip2, Oct 22, 2018.

  1. kyip2

    kyip2

    Joined:
    Jul 10, 2018
    Posts:
    4
    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.
     
  2. kyip2

    kyip2

    Joined:
    Jul 10, 2018
    Posts:
    4
    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.
     
    Last edited: Oct 22, 2018
  3. Gregoryl

    Gregoryl

    Unity Technologies

    Joined:
    Dec 22, 2016
    Posts:
    1,731
    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.
     
  4. kyip2

    kyip2

    Joined:
    Jul 10, 2018
    Posts:
    4
    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.
     
  5. Gregoryl

    Gregoryl

    Unity Technologies

    Joined:
    Dec 22, 2016
    Posts:
    1,731
    You could create another timeline and enable/disable that.
     
  6. kyip2

    kyip2

    Joined:
    Jul 10, 2018
    Posts:
    4
    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.
     
    Gregoryl likes this.