Search Unity

Official Announcing Cinemachine 3.0

Discussion in 'Cinemachine' started by marc_tanenbaum, Nov 15, 2022.

  1. marc_tanenbaum

    marc_tanenbaum

    Unity Technologies

    Joined:
    Oct 22, 2014
    Posts:
    637
    TLDR: Cinemachine 3.0 – a major version change – will be in pre-release for 2023.1 and full release for 2023.2.

    Since Unity acquired Cinemachine back in 2016, we've steadily added to and improved the feature set. Cinemachine now ranks as one of Unity's most-installed packages. So doing a full version bump is kind of a big deal and we want to make sure everyone is aware well in advance.

    Cinemachine 3.0 will be in pre-release for Unity 2023.1
    The upgrade will involve significant UX and API changes.

    [EDIT Dec 13] Here's a video explaining all the significant changes. [/EDIT]


    What problem does Cinemachine 3 address? In a word: consistency
    Cinemachine has always been a bit idiosyncratic in its implementation. The vast majority of the work in Cinemachine 3 removes these idiosyncrasies. We've rationalized names, removed under-the-table workarounds, simplified the UX, and generally made the entire tool "play nice" with Unity. The result is better support for features like presets and prefabs, an easier user onboarding process, less confusion for those programming against the Cinemachine API, and a clear path to grow the tool with a lot less technical debt.

    Should everyone adopt Cinemachine 3?
    Not necessarily. We've designed this as a "featureless" upgrade, meaning that we're not trying to tempt those of you in active development to throw out your work in favor of the new tool. Rather, we recommend Cinemachine 3 for new projects, starting in 2023.2. Others should stay with 2.x, safe in the knowledge that we'll keep providing bug fixes and support for at least the next two years.

    While we will provide an updater to help upgrade content, any code written for the Cinemachine 2.x API will likely cease to function without human intervention. Unfortunately, Unity's automatic script upgrader does not support all of the changes being made to our API.

    The minimum Unity Editor version required for Cinemachine 3.0 will be Unity 2022.2.

    For a full list of what's changing, please refer to this doc.

    The plan from here
    Always note that future plans are subject to change. The following represents our intended release schedule.

    Cinemachine 3.0.0-pre.3 is already available in pre-release
    • Unity 2022.2 users will only be able to access CM 3.0 by hand-editing the manifest.json or entering the package name in Package Manager's Add Package By Name field. In 2023.1, users will be able to access CM 3.0 by enabling pre-release packages, then finding the package in the Package Manager UI.
    Cinemachine 3.0 will be the default version of Cinemachine in 2023.2
    • In 2023.2, CM 3.0 will be accessible directly in Package Manager, without having to enable pre-release packages.
    Thanks to all of you for your continued support!
     
    Last edited: Dec 13, 2022
  2. Whatever560

    Whatever560

    Joined:
    Jan 5, 2016
    Posts:
    519
    Is the API subject to major changes or could we try it on already ?
     
  3. Gregoryl

    Gregoryl

    Unity Technologies

    Joined:
    Dec 22, 2016
    Posts:
    7,728
  4. Whatever560

    Whatever560

    Joined:
    Jan 5, 2016
    Posts:
    519
  5. Gregoryl

    Gregoryl

    Unity Technologies

    Joined:
    Dec 22, 2016
    Posts:
    7,728
    There are still some changes in the pipe. I would wait a little longer.
     
    Yuchen_Chang and Whatever560 like this.
  6. sacb0y

    sacb0y

    Joined:
    May 9, 2016
    Posts:
    874
    Plan on making any walk throughs of the changes?
     
  7. Whatever560

    Whatever560

    Joined:
    Jan 5, 2016
    Posts:
    519
  8. Gregoryl

    Gregoryl

    Unity Technologies

    Joined:
    Dec 22, 2016
    Posts:
    7,728
    We have made a walkthrough video, but I don't have info on the release date on-hand right now. Keep your eyes on this space.
     
  9. tatoforever

    tatoforever

    Joined:
    Apr 16, 2009
    Posts:
    4,369
    This is totally fine and is in fact a better way of introducing new features instead of slapping them on top of old ones, maintaining legacy code with systems that does similar things is depressing.
    We currently set cinemachine through its Inspector exposed properties, through timeline cinemachine track and on code is just few lines to blend between them. Code wise, is not an issue upgrade to new APIs. Is more of if/when the time comes for us to upgrade to v3, we would like to maintain existing cameras behavior at minimum.
    PS: Kudos for v3!
     
    sacb0y, marc_tanenbaum and Gregoryl like this.
  10. DevDunk

    DevDunk

    Joined:
    Feb 13, 2020
    Posts:
    5,060
    Does it play well with dots?
     
  11. Gregoryl

    Gregoryl

    Unity Technologies

    Joined:
    Dec 22, 2016
    Posts:
    7,728
    No, it's not targeting DOTS.
    We do have a DOTS version of Cinemachine in the works, though.
     
  12. sacb0y

    sacb0y

    Joined:
    May 9, 2016
    Posts:
    874
    How does this play with post processing? Are things like focus distance exposed so the calculation doesn't need to be done twice if needed for other effects?
     
  13. Gregoryl

    Gregoryl

    Unity Technologies

    Joined:
    Dec 22, 2016
    Posts:
    7,728
    Yes, the calculated focus distance is exposed in the appropriate places
     
    sacb0y likes this.
  14. marc_tanenbaum

    marc_tanenbaum

    Unity Technologies

    Joined:
    Oct 22, 2014
    Posts:
    637
    I've just received word that the video is basically done. Not exactly sure how long it'll take to get it posted, probably by end of the week.
     
    tatoforever and sacb0y like this.
  15. sacb0y

    sacb0y

    Joined:
    May 9, 2016
    Posts:
    874
    Awesome! That alone might make me switch, cause I have a whole script that's designed to try and pass through focus values to post processing. And it's sometimes hit or miss.

    I assume it still instances the volume? I would love a guide on reccomended implementations, later today I'll post my current scripts for reference.
     
  16. Gregoryl

    Gregoryl

    Unity Technologies

    Joined:
    Dec 22, 2016
    Posts:
    7,728
    Yes, CinemachineVolumeSettings still needs to make a Volume under the hood.

    Alternatively, CM3 comes with a new extension, CinemachineAutoFocus, dedicated to this. It does not require its own Volume or DoF profile. Rather, it pushes the focus distance directly into Unity's new focusDistance setting on the Camera, which you can use as you wish. One way to use this is to make your own Volume with DoF settings that uses the Camera's focusDistance value rather than the profile's.
     
  17. sacb0y

    sacb0y

    Joined:
    May 9, 2016
    Posts:
    874
    Yeah, thats more or less what i do now, but I have this script that has to take the cinemachine info per camera.

    Code (CSharp):
    1. using UnityEngine;
    2. using Beautify.Universal;
    3. using Cinemachine.PostFX;
    4. using Cinemachine;
    5. using Sirenix.OdinInspector;
    6.  
    7. [DisallowMultipleComponent]
    8. [ExecuteAlways]
    9. [SaveDuringPlay]
    10. public class BeautifyFocusCompatibility : CinemachineExtension
    11. {
    12.     public CinemachineVolumeSettings volumeSettings;
    13.     [HideIf("volumeSettings", null)]
    14.     public FocusTarget altFocusTarget = FocusTarget.LookAtTarget;
    15.     [HideIf("volumeSettings", null)]
    16.     public float focusOffset;
    17.     [ShowIf("altFocusTarget", FocusTarget.CustomTarget)]
    18.     public Transform followTarget;
    19.     /// <summary>
    20.     /// Enable this to ignore the current volume configuration, using custom settings can sometimes get better results.
    21.     /// </summary>
    22.     [HideIf("volumeSettings", null)]
    23.     public bool ignoreVolumeSettings = true;
    24.  
    25.     protected override void OnEnable()
    26.     {
    27.         volumeSettings = this.gameObject.GetComponent(typeof(CinemachineVolumeSettings)) as CinemachineVolumeSettings;
    28.     }
    29.  
    30.     /// <summary>Apply PostProcessing effects</summary>
    31.     /// <param name="vcam">The virtual camera being processed</param>
    32.     /// <param name="stage">The current pipeline stage</param>
    33.     /// <param name="state">The current virtual camera state</param>
    34.     /// <param name="deltaTime">The current applicable deltaTime</param>
    35.     protected override void PostPipelineStageCallback(CinemachineVirtualCameraBase vcam, CinemachineCore.Stage stage, ref CameraState state, float deltaTime)
    36.     {
    37.         // Set the focus after the camera has been fully positioned.
    38.         if (stage == CinemachineCore.Stage.Finalize)
    39.         {
    40.             // Only process if this current camera is active
    41.             if (vcam.VirtualCameraGameObject == this.gameObject)
    42.             {
    43.                 //Do not run if instance does not have dof enabled
    44.                 if (BeautifySettings.sharedSettings.depthOfField.value)
    45.                 {
    46.                     //If volume settings is not null process from that
    47.                     if (volumeSettings != null)
    48.                     {
    49.                         float focusDistance = volumeSettings.m_FocusOffset;
    50.                         if (volumeSettings.m_FocusTracking == CinemachineVolumeSettings.FocusTrackingMode.LookAtTarget)
    51.                             focusDistance += (state.FinalPosition - state.ReferenceLookAt).magnitude;
    52.                         else
    53.                         {
    54.                             Transform focusTarget = null;
    55.                             switch (volumeSettings.m_FocusTracking)
    56.                             {
    57.                                 default: break;
    58.                                 case CinemachineVolumeSettings.FocusTrackingMode.FollowTarget: focusTarget = VirtualCamera.Follow; break;
    59.                                 case CinemachineVolumeSettings.FocusTrackingMode.CustomTarget: focusTarget = volumeSettings.m_FocusTarget; break;
    60.                                 case CinemachineVolumeSettings.FocusTrackingMode.Camera: focusDistance = volumeSettings.m_FocusOffset; break;
    61.                             }
    62.                             if (focusTarget != null)
    63.                                 focusDistance += (state.FinalPosition - focusTarget.position).magnitude;
    64.                         }
    65.                         GameEventHub.PublishUpdateDistance(Mathf.Max(0, focusDistance));
    66.                     }
    67.                     //If volume settings is null determine if volume settings is desired if not work off custom data, else find the volume settings
    68.                     else if (volumeSettings == null)
    69.                     {
    70.                         if (ignoreVolumeSettings)
    71.                         {
    72.                             float focusDistance = focusOffset;
    73.                             if (altFocusTarget == FocusTarget.LookAtTarget)
    74.                                 focusDistance += (state.FinalPosition - state.ReferenceLookAt).magnitude;
    75.                             else
    76.                             {
    77.                                 Transform focusTarget = null;
    78.                                 switch (altFocusTarget)
    79.                                 {
    80.                                     default: break;
    81.                                     case FocusTarget.FollowTarget: focusTarget = VirtualCamera.Follow; break;
    82.                                     case FocusTarget.CustomTarget: focusTarget = followTarget; break;
    83.                                     case FocusTarget.None: focusDistance = focusOffset; break;
    84.                                 }
    85.                                 if (focusTarget != null)
    86.                                     focusDistance += (state.FinalPosition - focusTarget.position).magnitude;
    87.                             }
    88.                             /*
    89.                             if (BeautifySettings.instance != null)
    90.                             {
    91.                                 BeautifySettings.sharedSettings.depthOfFieldDistance.Override(Mathf.Max(0, focusDistance));
    92.                             }
    93.                             */
    94.                             GameEventHub.PublishUpdateDistance(Mathf.Max(0, focusDistance));
    95.                         }
    96.                         else
    97.                         {
    98.                             volumeSettings = this.gameObject.GetComponent(typeof(CinemachineVolumeSettings)) as CinemachineVolumeSettings;
    99.                         }
    100.  
    101.                     }
    102.                 }
    103.             }
    104.         }
    105.     }
    106. }
    107.  
    108. public enum FocusTarget
    109. {
    110.     None = 0,
    111.     LookAtTarget = 1,
    112.     FollowTarget = 2,
    113.     CustomTarget = 3,
    114.     Camera = 4
    115. }
    116.  
    If this whole process can be simplified that would be fantastic.
     
  18. marc_tanenbaum

    marc_tanenbaum

    Unity Technologies

    Joined:
    Oct 22, 2014
    Posts:
    637
    Here it is! (I'll also edit the original post to add it.)


     
  19. Yuchen_Chang

    Yuchen_Chang

    Joined:
    Apr 24, 2020
    Posts:
    127
    I've just watch the video, and the improvements are fascinating! No hidden gameobject pipeline, better naming, Splines package supporting, GroupComposer -> move to Extensions, split screens by channel (not unity layer) ... everything is so good!
    I appreciate the hard work of the Cinemachine team. Great Job!! Can't wait to use this in my new projects.
     
  20. Whatever560

    Whatever560

    Joined:
    Jan 5, 2016
    Posts:
    519
    I was just thinking, is it a hard rule for the minimum version, or mostly a "use at your own risk" in earlier version? For instance, right now I'm using the Spline package in 2021 LTS, which looks like one of the reason or the 2022.2 requirement, it does compile and is functional.

    Anyway we'll probably switch the 2022 LTS when it's realeased, but if we can start to work on in it in the meantime it'd be great.
     
  21. Gregoryl

    Gregoryl

    Unity Technologies

    Joined:
    Dec 22, 2016
    Posts:
    7,728
    Unfortunately 2022.2 is a hard minimum, because of splines and for other reasons.
     
  22. MechaWolf99

    MechaWolf99

    Joined:
    Aug 22, 2017
    Posts:
    294
    Hey, love to see these changes, the UX is so much better! And the more component based modularity is great!

    However one thing really bothers me and that is the naming of
    CmCamera
    , I find to very off putting.
    Just in general using a shorthand for a class name goes against C# guidelines. It makes it harder (if only a bit) to know what the component is. And beyond that, every other component in Cinemachine uses the full
    Cinemachine___
    name. So not only does it look kind of ugly, it is also inconsistent. I understand if it is too late to change it now, or if you have some reason for having it as it is. But I thought I would at least share.
    I still would have preferred something like
    VirtualCamera
    as the naming convention instead of
    Cinemachine
    , as it tells you what it is, and not what it is from, but I understand the reasoning.

    Anyways, that is just my two cents. Love the new scene tools integration too btw!
     
  23. Onigiri

    Onigiri

    Joined:
    Aug 10, 2014
    Posts:
    486
    I also think it should be Cinemachine Camera like every other component that starts with "Cinemachine"
     
    MirzaBeig, graskovi and MechaWolf99 like this.
  24. Baste

    Baste

    Joined:
    Jan 24, 2013
    Posts:
    6,338
    Everything there is great! The only thing I reacted to very negatively was "Unity now has a different product named VirtualCamera". That is the worst thing! What the hell? You can't have a "virtual camera" concept for half a decade and then turn around and go "that's no a cmCamera and there's a different thing now called VirtualCamera".

    What's that other virtual camera, and is there a way we can shout at the people responsible for it? They've made a product that's 100% never going to be found by anyone, so they're making Cinemachine worse and wasting their own time.
     
  25. marc_tanenbaum

    marc_tanenbaum

    Unity Technologies

    Joined:
    Oct 22, 2014
    Posts:
    637
    I'm afraid that would be me...or, more accurately...that would be me accepting that Virtual Camera is a term already standardized within in the film industry to mean apps such as this. We had a choice of either bucking an industry standard or changing our terminology to align. Since we were already planning to re-name a number of things – and given the reality that Unity is increasingly used in TV/film workflows – the team agreed that it made more sense to go through the short-term pain of a re-name than to go our own way.
     
  26. petey

    petey

    Joined:
    May 20, 2009
    Posts:
    1,824
    This all sounds awesome! Just wondering, with the minimum being 2022.2 does that there might be a version that works with 2022 LTS at some point? If it's 2023 only, that means it would be over a year away for me at least 'cause I have to wait for the LTS :(.
    Anyway, great work!
     
  27. Gregoryl

    Gregoryl

    Unity Technologies

    Joined:
    Dec 22, 2016
    Posts:
    7,728
    Our goal is to have it work with 2022.2 and up, so that would include any 2022 LTS release.
     
    petey and Yuchen_Chang like this.
  28. petey

    petey

    Joined:
    May 20, 2009
    Posts:
    1,824
    Awesome! That's great news :D
    Hmm, how would I find the package name for the "Add Package By Name" field? I've can't seem to get anything to work. :confused:

    Edit - Got it!
    Screenshot 2023-02-28 at 2.06.03 pm.png
     
    Last edited: Feb 28, 2023
    Gregoryl likes this.
  29. Gregoryl

    Gregoryl

    Unity Technologies

    Joined:
    Dec 22, 2016
    Posts:
    7,728
    @petey 3.3.0.pre-4 has been released, you should use that
     
    Yuchen_Chang and petey like this.
  30. filod

    filod

    Joined:
    Oct 3, 2015
    Posts:
    224
    great to hear this, and any timeline for dots?
     
  31. Gregoryl

    Gregoryl

    Unity Technologies

    Joined:
    Dec 22, 2016
    Posts:
    7,728
    I can't share any details about the timeline for this right now. CM.DOTS is dependent on some core features that are still in a transitional state.
     
  32. Ofx360

    Ofx360

    Joined:
    Apr 30, 2013
    Posts:
    155
    Screenshot 2023-03-09 133653.png

    I can't seem to get the camera to follow a smooth, vertical arc using the FreeLook Camera on 2.9.5 (Red line is the Cinemachine's Y arc)

    Is this something that could be fixed/changed in 3.0?

    And something I found weird in 2.9+ is that the FreeLook camera's X and Y axis have different speeds values with no intuitive way of aligning them (or maybe there is a way, but i don't know it - I'd love some advice!). So i'm left nudging values till i get something that sort of feels like the X and Y move at similar speeds. It would be great is there was another speed option that would make the two axis' speed aligned
     
  33. Gregoryl

    Gregoryl

    Unity Technologies

    Joined:
    Dec 22, 2016
    Posts:
    7,728
    The speeds are units per second. The X axis units are degrees, and the Y axis value ranges from -1 to +1, so for a full half-circle the Y speed should be about 1/90th of the X speed for an equivalent feel.

    FreeLook wasn't really meant for circular orbits. Try instead a vcam with FramingTransposer + POV. POV uses degrees for both X and Y axes, so you'll be able to set the speeds to the same thing.

    In CM3, the FreeLook has been completely reworked, btw.
     
    Yuchen_Chang likes this.
  34. UniqueCode

    UniqueCode

    Joined:
    Oct 20, 2015
    Posts:
    65
    I know you are probably tired of being asked this all the time and there's no good answer either but... can you give us a very rough time frame? This year? Else we just need to use a proxy, same as with animation.
    edit: just realized that it's not this easy because of physics checks inside Cinemachine. Here's how: Dots camera

    As a dots user I get the feeling that the "new" world will only ever be on-par with the existing stuff in like 10 years because you guys keep extending the "old" world. Getting mixed signals here.
     
    Last edited: Jun 1, 2023
    Yuchen_Chang likes this.
  35. Gregoryl

    Gregoryl

    Unity Technologies

    Joined:
    Dec 22, 2016
    Posts:
    7,728
    I wish I had a good answer for you, but I don't. Development on CM.DOTS is temporarily paused while we put out other fires.

    As for new and old worlds, please rest assured that DOTS is high on the list of Unity priorities, and it is actively progressing. CM.DOTS less so, because it's less essential - you can still use CM classic alongside DOTS stuff.
     
  36. TminusDoom

    TminusDoom

    Joined:
    May 18, 2023
    Posts:
    2
    I was wondering what features of CM3 would be different from the current 2022.3 and the full release in 2023.2 if I started a new project today.
     
  37. UniqueCode

    UniqueCode

    Joined:
    Oct 20, 2015
    Posts:
    65
    CM3 is designed as a "featureless update", so usability and structure for users.
     
  38. TminusDoom

    TminusDoom

    Joined:
    May 18, 2023
    Posts:
    2
    Sorry, what I meant was, is there any reason to use 2023 now that would improve CM3, or can I use CM3 in 2022.3 with the same functionality.
     
  39. Gregoryl

    Gregoryl

    Unity Technologies

    Joined:
    Dec 22, 2016
    Posts:
    7,728
    You can use CM3 in 2022.2 and up with no loss of functionality.
     
  40. mitaywalle

    mitaywalle

    Joined:
    Jul 1, 2013
    Posts:
    253
    This refactoring is great, nices shorter naming, clearer inspector is awesome. But still no simple setup for First Person Camera.....
     
    Anflogue and Gregoryl like this.
  41. a436t4ataf

    a436t4ataf

    Joined:
    May 19, 2013
    Posts:
    1,933
    Really?

    This info is completely missing from the 3.0.0-pre[latest] docs right now.

    Note: 'entering the package name in ..' has no effect: it installs CM-2.9.7, and there appears no way to prevent it.
     
    Anflogue likes this.
  42. Anflogue

    Anflogue

    Joined:
    Nov 16, 2020
    Posts:
    2
    Is this forum closed? No answering to the questions.
     
  43. Gregoryl

    Gregoryl

    Unity Technologies

    Joined:
    Dec 22, 2016
    Posts:
    7,728
  44. zov

    zov

    Joined:
    Feb 19, 2013
    Posts:
    4
    HELLO My CINEMACHINE IS 3.0.1 buti made a mistake to make it back to 2.9.7 ,
    now i want back to 3.0.1 BUT NOT FOUND 3.0.1 in package manager,pls save me! thank you ! thank you very much!
     
  45. DevDunk

    DevDunk

    Joined:
    Feb 13, 2020
    Posts:
    5,060
    Edit it in the package manifest file
     
  46. Lurking-Ninja

    Lurking-Ninja

    Joined:
    Jan 5, 2024
    Posts:
    482
    Use the
    Add package by name...
    function. You can specify version number in the dialog box.
    https://docs.unity3d.com/Manual/upm-ui-quick.html
     
    Gregoryl likes this.
  47. Gregoryl

    Gregoryl

    Unity Technologies

    Joined:
    Dec 22, 2016
    Posts:
    7,728