Search Unity

  1. Calling all beginners! Join the FPS Beginners Mods Challenge until December 13.
    Dismiss Notice
  2. It's Cyber Week at the Asset Store!
    Dismiss Notice

New Cinemachine v1.5

Discussion in 'Cinemachine' started by Adam_Myhill, Mar 5, 2017.

  1. Adam_Myhill

    Adam_Myhill

    Unity Technologies

    Joined:
    Dec 22, 2016
    Posts:
    332
  2. Gregoryl

    Gregoryl

    Unity Technologies

    Joined:
    Dec 22, 2016
    Posts:
    3,134
    Good news: There's a new version of Cinemachine available for download that has a scripting API. Behaviours and components are no longer internal, and there is an API for adding/removing/accessing Cinemachine components by script (the things that are in the "Aim", "Body", and "Noise" categories). A simple "Scripting" example scene is included which should tell you enough to get you going. Feedback and comments welcome.

    You can find it here:
    https://drive.google.com/open?id=0BxXa-EKSOUL9a20tU2lydDhYdVk
     
  3. Gregoryl

    Gregoryl

    Unity Technologies

    Joined:
    Dec 22, 2016
    Posts:
    3,134
    Ahhh. I see Adam already said all that in the post just before. Sorry for the spam, and where's the coffee?
     
  4. Murgilod

    Murgilod

    Joined:
    Nov 12, 2013
    Posts:
    6,328
    So I've not been following for a while now, but it seems that Base Rig and Game Rig are gone in favour of a more unified Cinemachine, along with a scripting API now? Is this correct?
     
  5. Gregoryl

    Gregoryl

    Unity Technologies

    Joined:
    Dec 22, 2016
    Posts:
    3,134
    Yes that's correct.
     
  6. dba999

    dba999

    Joined:
    Oct 3, 2014
    Posts:
    19
    Holy toledo ! The API is here ! So many thanks guys, this is a huge gift !
    Now, in minutes I got access to the m_LookAt & m_Follow so easily. (and I'm not a great coder)
    I even managed to use the m_HeightOffset of the Orbital Transposer by using a CinemachineVirtualCamera.GetComponentPipeline() as you suggested. This is amazing.

    By the way, I'm in love with this orbital transposer <3 The Recenter to target heading is just perfect.
    Thank you again team.
     
    Adam_Myhill likes this.
  7. Gregoryl

    Gregoryl

    Unity Technologies

    Joined:
    Dec 22, 2016
    Posts:
    3,134
    Thanks for the positive feedback!

    One thing, though: GetComponentPipeline() is no longer the recommended way to access the components. I would instead use GetCinemachineComponent<>(). In the case of the OrbitalTransposer, it would look something like this:

    var transposer = vcam.GetCinemachineComponent<CinemachineOrbitalTransposer>();
    if (transposer != null)
    {
    bla bla bla
    }
     
    dba999 likes this.
  8. dba999

    dba999

    Joined:
    Oct 3, 2014
    Posts:
    19
    Perfect ! I suspected something like that, much more clean.
    This thread is like Christmas for me ^^
     
  9. dba999

    dba999

    Joined:
    Oct 3, 2014
    Posts:
    19
    Sorry if it's explained somewhere and I didn't pay attention, but I'd like to know what other parameters could be set instead of the Mouse X or Mouse Y which are, if I'm correct, input axis names, in the Freelook script or even in the transposer component.
    Let's say I would like to use mobile touch commands instead, how would I proceed ?
     
  10. Gregoryl

    Gregoryl

    Unity Technologies

    Joined:
    Dec 22, 2016
    Posts:
    3,134
  11. kilik128

    kilik128

    Joined:
    Jul 15, 2013
    Posts:
    875
    can you say what's i miss

    got lot of error on import like this
    Assets/Cinemachine/Code/Timeline/CinemachineMixer.cs(2,19): error CS0234: The type or namespace name `Playables' does not exist in the namespace `UnityEngine'. Are you missing an assembly reference?

    Assets/Cinemachine/Code/Timeline/CinemachineShot.cs(5,19): error CS0234: The type or namespace name `Timeline' does not exist in the namespace `UnityEngine'. Are you missing an assembly reference?


    ...
     
  12. Gregoryl

    Gregoryl

    Unity Technologies

    Joined:
    Dec 22, 2016
    Posts:
    3,134
    It's because you don't have Timeline, and you imported the Timeline portion of Cinemachine. Delete (or comment out) the Cinemachine scripts that are generating the errors. You can just delete the entire "Cinemachine/Timeline" asset folder in your project.
     
  13. kilik128

    kilik128

    Joined:
    Jul 15, 2013
    Posts:
    875
    where found Timeline ?
     
  14. Gregoryl

    Gregoryl

    Unity Technologies

    Joined:
    Dec 22, 2016
    Posts:
    3,134
    YourProject/Assets/Cinemachine/Timeline
     
  15. Gregoryl

    Gregoryl

    Unity Technologies

    Joined:
    Dec 22, 2016
    Posts:
    3,134
  16. kilik128

    kilik128

    Joined:
    Jul 15, 2013
    Posts:
    875


    ok it's one special unity
     
  17. Adam_Myhill

    Adam_Myhill

    Unity Technologies

    Joined:
    Dec 22, 2016
    Posts:
    332
  18. AFrisby

    AFrisby

    Joined:
    Apr 14, 2010
    Posts:
    213
    Quick question - is there a way to change the Body transposer offset mode to Lock to Target, but ignore the Z axis - so the camera will never rotate on the Z axis, but will have rotation side-to-side (Y) and up-and-down (X)?

    Edit: that is to say, the Locked with Up Vector appears only to track the Y axis (I'd like X tracked too)
     
  19. Gregoryl

    Gregoryl

    Unity Technologies

    Joined:
    Dec 22, 2016
    Posts:
    3,134
    Out of the box, no, but it would be a good thing to add. You could add it yourself by writing your own transposer extension, or we could just add another value to the enum (I prefer the latter). Stay tuned :)
     
    AFrisby likes this.
  20. AFrisby

    AFrisby

    Joined:
    Apr 14, 2010
    Posts:
    213
    Haha, I'd prefer the latter, but I suspect I might need to do it sooner - is it possible to write a quick extension which just runs after the built-in transposer and resets the Z value?
     
  21. Gregoryl

    Gregoryl

    Unity Technologies

    Joined:
    Dec 22, 2016
    Posts:
    3,134
    @AFrisby Thanks for the great suggestion. The feature is in, and you'll see it in the next beta. ETA this week sometime.
     
    Alverik and AFrisby like this.
  22. Gregoryl

    Gregoryl

    Unity Technologies

    Joined:
    Dec 22, 2016
    Posts:
    3,134
    The short answer is yes it's possible. How you would go about it will be made much clearer when the next beta is released. Since that beta includes the feature in question, it's best just to wait.
     
    Alverik likes this.
  23. AFrisby

    AFrisby

    Joined:
    Apr 14, 2010
    Posts:
    213
    Thanks - I actually ended up writing a Post event hook - which zero'd the dutch and set the up axis; which did work - but I'll happily ditch that hack once you guys have the next build up. :)
     
  24. Adam_Myhill

    Adam_Myhill

    Unity Technologies

    Joined:
    Dec 22, 2016
    Posts:
    332
    Makes sense @AFrisby. Update is coming very soon.

    Thanks for the suggestion of this feature! This new mode works great and opens up a bunch of camera opportunities.

    We will be dropping a new version of CM shortly, one with no DLLs - totally open - so people can do whatever they want with it. The only bad news is that it won't be backwards compatible, so you'll have to make new cameras. We are hoping that this is the last update which breaks backwards compatibility.
     
    OCASM, JakubSmaga, vivalavida and 5 others like this.
  25. JakubSmaga

    JakubSmaga

    Joined:
    Aug 5, 2015
    Posts:
    416
    Can we expect update this week? And also will it include "editor" camera that i was talking about? Thanks! :cool:
     
    Alverik likes this.
  26. Adam_Myhill

    Adam_Myhill

    Unity Technologies

    Joined:
    Dec 22, 2016
    Posts:
    332
    @JacobSmaga, it's going to be a little longer than next week for the new CM drop. Because it's completely open, we need to deliver it via the Asset Store which requires a bunch of extra work to be done.

    As for the 'editor' camera, we haven't gotten to that yet, there's a few more fixes and features which we are finishing up and then the documentation for everything.
     
    Alverik and JakubSmaga like this.
  27. JakubSmaga

    JakubSmaga

    Joined:
    Aug 5, 2015
    Posts:
    416
    @Adam_Myhill @Gregoryl Is Cinemachine going to be built-in inside Unity 2017.1 public beta which will start in a few days?
     
    Alverik likes this.
  28. Adam_Myhill

    Adam_Myhill

    Unity Technologies

    Joined:
    Dec 22, 2016
    Posts:
    332
    @JacobSmaga , CM v1.5 is going to go on the Asset Store (for free) until Unity 2017.2. The main reason is that we need the time to finish up all the documentation and create a lot more really good example scenes.
     
    JakubSmaga likes this.
  29. Gray_Master

    Gray_Master

    Joined:
    Jun 20, 2010
    Posts:
    152
    @Adam_Myhill, May be more correctly add to CM package namespace UnityEngine.Playable (in U3d 5.6 f3 this assembly is not exist & timeline is not work - only CM Core + PostFx) ?
     
  30. Gregoryl

    Gregoryl

    Unity Technologies

    Joined:
    Dec 22, 2016
    Posts:
    3,134
    @Gray_Master Yes, Cinemachine is compatible back to 5.4. Just omit the Timeline integration scripts and you're good to go. Same for PostFX.
     
  31. conro

    conro

    Joined:
    Mar 15, 2015
    Posts:
    6
    Hello! I got this wonderful asset and I tried it with my own project. However, tracking a Rigidbody object (and its children) seems to be causing jitter. Is "Improved collider filter, to help reduce jitter" in TODO list mean to this problem?
     
  32. Gregoryl

    Gregoryl

    Unity Technologies

    Joined:
    Dec 22, 2016
    Posts:
    3,134
    Jitter tends to emerge when you have a vcam with a composer that is tracking an object that is not moving smoothly. You can test this by turning the damping to 0. If the jitter goes away then that's it. Damping works best on a smoothly-moving target. Collider jitter (the TODO item) is different - it refers to positional jitter of the vcam that occurs sometimes when a collider is attached
     
  33. Alverik

    Alverik

    Joined:
    Apr 15, 2016
    Posts:
    393
    Had the same issue... in my case it's because I'm using forces... if you apply forces at some point during you objects movement then try changing your object's rigidbody's Interpolate option to Extrapolate. That'll smooth things out a bit.
     
  34. conro

    conro

    Joined:
    Mar 15, 2015
    Posts:
    6
    Thank you for answering my ( may be redundant ) questions.
    I should have read the Chinemachine v1.1 thread at least before the post.:(
    It seems that the jitter disappears by making damping zero indeed.

    Thanks for your reply. yes, I am using AddForce too.
    Unfortunately it seems that Extrapolate does not get much better ...However, when testing with a simple rigid body, although low frequency jitter remains, it certainly improves. (perhaps my target airplane object is too complicated.)

    -----

    I have not gotten any idea though yet, but once I leave. I may post again. thanks all.
     
  35. Adam_Myhill

    Adam_Myhill

    Unity Technologies

    Joined:
    Dec 22, 2016
    Posts:
    332
    @conro , We have had this issue arise a number of times. Technically, it's not a Cinemachine issue but it's something we're looking right now at how we can handle it better.

    It's very common for object movement to not be smooth due to the interpolation method or impulses - spikes - in delta time / frame rate. A small spike can cause the camera to jump. Object motion can look smooth when the translation jumps are aligned with framerate but in actuality, they are actually stuttering really heavily.

    These stutters can freak Cinemachine out because the object isn't moving smoothly. Setting damping settings to 0 'hides' the problem because now the camera is stuttering with the object and you can't see it as much. If you look at the rest of the world though, you should be able to see that the motion isn't smooth.

    So it's kind of not really Cinemachine's problem but we want to handle it anyways. As we speak, superstar GregoryL is looking at bomb-proofing our damping code in hopes of making it smooth out whatever the heck the targets are doing.

    It's a double-edged sword though as this will just hide translation issues in your project which might have side effects elsewhere...
     
    Alverik likes this.
  36. conro

    conro

    Joined:
    Mar 15, 2015
    Posts:
    6
    @Adam_Myhill
    I am glad to know that the team is trying to manage such a problem.

    Since I encountered the same problem when I made a camera script in the past, I can understand that the jitter problem is not actually caused by Cinemachine.
    At that time, I noticed that some people who attempted to create scripts to follow Rigidbody objects with a smoothed camera encountered similar problems.
    (But I did not have confidence that the jitter I encountered this time is the same.)

    I solved the problem by moving the smoothing (Quaternion.Slerp) tracking the object from LateUpdate() into FixedUpdate () at that time, just like in the answer here.

    It seems that AbstractTargetFollower of UnityStandardAsset is also handling the problem by equipping a selectable update type dropdown and choosing whether to rotate the camera within LateUpdate or within FixedUpdate.
    Until I knew Cinemachine the day before yesterday, I was tracking my plane using HandHeldCam (Inherited from AbstractTargetFollower). As long as HandHeldCam 's UpdateType is FixedUpdate, tracking of the plane whose Rigidbody Interpolate is set to "None" did not encounter jitter problems at all. (Once I change the UpdateType to LateUpdate, jitter will come soon.)

    I thought that if Cinemachine could have the option of tracking in FixedUpdate, at least Jitter for physical objects running on FixedUpdate clock could be avoided.
    In Cinemachine's implementation this may not be so simple, but I can not think of any other means to avoid Rigidbody's jitter ...
     
    Last edited: Apr 12, 2017
    Alverik likes this.
  37. Bastienre4

    Bastienre4

    Joined:
    Jul 8, 2014
    Posts:
    65
    Hello ! Thanks for this awesome tool ! Can we have an idea of the update release date ? :)
     
  38. Alverik

    Alverik

    Joined:
    Apr 15, 2016
    Posts:
    393
    Yeah, I've also heard that the camera follow needs to match the type of loop you are using to move the object to avoid jitter (so Update or FixedUpdate, which would probably mean, LateUpdate and... umm, is there such a thing as LateFixedUpdate XD?). lol. but it would be pretty cool if we could select the loop to be used from a dropdown, I personally prefer to move my character using the Rigidbody so it can detect collisions better, so I have to use fixed update to move the player.
     
    conro likes this.
  39. Adam_Myhill

    Adam_Myhill

    Unity Technologies

    Joined:
    Dec 22, 2016
    Posts:
    332
    Cinemachine v2.0 will be released on the Asset Store sometime next month. It is a huge upgrade, we can't wait to see what all of you create with it! More news on that in the next couple of weeks,
     
  40. SEFD-Stuff

    SEFD-Stuff

    Joined:
    Apr 10, 2015
    Posts:
    4
    Hey, will v2.0 include the "Playables" Namespace library? I am drooling to get my hands on timeline & make some demos with it, but of course without the Playables library I can't do anything. If not, any idea how I can get my hands on it now or when I will be able to? :D

    Also curious question, I see that you access namespaces, specifically PostProcessing & Playables that are nested within UnityEngine which makes me assume that their implementation is in the pipeline, any clues as to when it'll be built into Unity?

    Thank you guys for this awesome tool by the way, especially for making it free, I can't wait for more updates! :D
     
  41. JakubSmaga

    JakubSmaga

    Joined:
    Aug 5, 2015
    Posts:
    416
    "CM v1.5 is going to go on the Asset Store (for free) until Unity 2017.2." So it's going to be built inside 2017.2! :D
     
  42. Gregoryl

    Gregoryl

    Unity Technologies

    Joined:
    Dec 22, 2016
    Posts:
    3,134
    We've added an UpdateMode dropdown to CinemachineBrain, where you can choose the update loop. Set it to FixedUpdate for RigidBody animations. Actually, you can also set the animator's update mode to Animate Physics, so now everyone can work happily together, jitter-free!

    And yes, there is a "LateFixedUpdate" :) just set the CinemachineBrain last in ScriptExecutionOrder.
     
    Too-Nerd-To-Die, Alverik and conro like this.
  43. SEFD-Stuff

    SEFD-Stuff

    Joined:
    Apr 10, 2015
    Posts:
    4
    alright, I guess I'll just sit patiently for Unity 2017.2. sidenote, this new naming convention change is throwing me off haha
     
    Alverik likes this.
  44. conro

    conro

    Joined:
    Mar 15, 2015
    Posts:
    6
    Amazing news, I appreciate team's efforts!
    I'm looking forward to the next release:D
     
    Alverik likes this.
  45. Foriero

    Foriero

    Joined:
    Jan 24, 2012
    Posts:
    470
    Hello, is CM already available at GITHUB? Please it is hard to keep track. :)
     
    Alverik likes this.
  46. ArthurT

    ArthurT

    Joined:
    Oct 26, 2014
    Posts:
    73
    Using Unity 2017.1.0b1 and Cinemachine 1.5, seems to be the reason why the guidelines won't show up. Is there any patch planned for the current version to support the Unity 2017 beta releases?
     
    corn likes this.
  47. Adam_Myhill

    Adam_Myhill

    Unity Technologies

    Joined:
    Dec 22, 2016
    Posts:
    332
    No need to wait until 2017.2 (August), grab Cinemachine V2 once it's up on the asset store, no need to wait past that version.
     
    Alverik likes this.
  48. Adam_Myhill

    Adam_Myhill

    Unity Technologies

    Joined:
    Dec 22, 2016
    Posts:
    332
    Hi @ArthurT , Cinemachine v2 will fix that, coming soon.
     
  49. Rod-Galvao

    Rod-Galvao

    Joined:
    Dec 12, 2008
    Posts:
    198
    Is the new CM compatible with Cinema Director?
     
  50. Alverik

    Alverik

    Joined:
    Apr 15, 2016
    Posts:
    393
    Well, seeing how each CM camera is just a regular object, then you should probably be able to translate them across a scene, turn them on or off, or modify other exposed fields, just like any other object (even using Cinema Director). But for further integration you should probably ask in the Cinema director forums page once CM v2.0 is out (since, in reality, the responsibility to integrate Cinema director to CM would be on Cinema Director's author, not unity... since Cinema Director is a third party plugin...).