1. Help us improve the editor usability and artist workflows. Join our discussion to provide your feedback.
    Dismiss Notice
  2. We're looking for feedback on Unity Starter Kits! Let us know what you’d like.
    Dismiss Notice
  3. We’re giving 2017.1 beta testers a chance to win t-shirts and a Nintendo Switch. Read more on the blog.
    Dismiss Notice
  4. Unity 2017.1 beta is now available for download.
    Dismiss Notice
  5. Unity 5.6 is now released.
    Dismiss Notice
  6. Get further faster with the Unity Plus Accelerator Pack, free for new Unity Plus subscribers for a limited time. Click here for more details.
    Dismiss Notice
  7. Check out all the fixes for 5.6 on the patch releases page.
    Dismiss Notice
  8. Learn how you'll soon be able to publish your games to China in four simple steps with Xiaomi. Sign up now for early access.
    Dismiss Notice

Using Cinemachine Dolly path in v2.0

Discussion in 'Timeline & Cinemachine' started by Adam_Myhill, May 17, 2017 at 9:46 AM.

  1. Adam_Myhill

    Adam_Myhill

    Unity Technologies

    Joined:
    Dec 22, 2016
    Posts:
    105
    While the documentation is being finished, I thought it would write a quick post on how to use the new Dolly path feature in Cinemachine v2.0

    It allows you to create a very smooth path for the camera to go down and you can animate the speed or have the camera 'Auto follow' the subject. You can even auto follow the subject and animate a little offset so the camera goes a bit further ahead or behind, driven by a curve in Timeline. Neat!

    Install Unity 2017.1b3+ You must be above beta 3

    Install Cinemachine 2.0 There's a link to v2.0 from the v1.1 on the Asset Store too.

    If you into fantastic postfx, get the Post Processing Stack

    Open your scene and Intialize Cinemachine by going Cinemachine->Create Virtual Camera from the top toolbar. You'll see that a CM 'Brain' is created on the main Unity camera. This is where all the camera mojo happens and it has some global settings.

    Create an empty object in your hierarchy. Call it 'CM dolly path of wonder'

    Add the CM Path component. Search Path.
    upload_2017-5-17_17-25-1.png


    Add some waypoints. Note you can add more later, delete and even rearrange them.
    Note I increased the values of X for each waypoint.
    upload_2017-5-17_17-26-58.png

    You can also adjust the path in the scene view. The extra set of handles per waypoint are the tangent handles.
    upload_2017-5-17_17-28-47.png


    Now select a CM virtual camera. Set the 'Body' to be Dolly and drag your new path object into the path slot.
    You probably want the camera to Look At something and if you want to use the Auto Dolly, then have it Follow something too
    upload_2017-5-17_17-33-22.png

    If you're not going to use Auto Dolly, then animate Path Position any way you want. It animates really nicely from Timeline, just drag the virtual camera onto Timeline and say Animate

    Animating Path Offset gives you control of being a little ahead or behind, etc.

    Boom!
     

    Attached Files:

    Last edited: May 17, 2017 at 10:27 AM
  2. laurentlavigne

    laurentlavigne

    Joined:
    Aug 16, 2012
    Posts:
    987
    Look at them gizmos - nice!
    Can path component be used for other things? Like moving enemies in a SHMUP for example?
     
    Alverik likes this.
  3. Alverik

    Alverik

    Joined:
    Apr 15, 2016
    Posts:
    240
    Awesomeness! thanks for this. It's something I've been wanting for a while and it works really nice :)
     
  4. ArthurT

    ArthurT

    Joined:
    Oct 26, 2014
    Posts:
    59
    That's fantastic! Wasn't even aware there was a Dolly path feature implemented in CM 2.0.
    I would like to suggest the ability to set the current editor camera position and rotation into the selected path for quicker set up.

    Unrelated, I think it would beneficial for all of us if it's a possibility for the Cinemachine codebase being on Github, where any of us could do a PR to make improvements where needed. :)
     
  5. Adam_Myhill

    Adam_Myhill

    Unity Technologies

    Joined:
    Dec 22, 2016
    Posts:
    105
    @ArthurT there's even more lurking in CM 2.0 which people don't yet know about. The documentation task is rather enormous.

    Github.. Lots involved with that idea. Eventually CM will be delivered by the Unity Package Manager. You might make an improvement but someone else may not and we'd become code reviewers and gatekeepers. There's a lot of touchy stuff in there which has crazy knock-ons which one might not expect.

    Think of all the systems and the order of operations. We auto compose on some target, then there's the dutch rotation, then there's the noise, then the subject goes over top which would make for gimble-lock hell while blending to a totally different camera setup - yet it all works. Touching just one of those systems can cause weird results in places you wouldn't expect, we've seen it many times and we're the ones who made it.

    That said, if you've got ideas on improving something, please let us know or try the change locally and let us know how it goes.
     
    Alverik and laurentlavigne like this.