Search Unity

Official New version of Cinemachine 3 pre-release 7 is now available

Discussion in 'Cinemachine' started by Gregoryl, May 5, 2023.

  1. Gregoryl

    Gregoryl

    Unity Technologies

    Joined:
    Dec 22, 2016
    Posts:
    7,720
    Cinemachine 3.0.0-pre.7 is now available. The focus this time is on blending.

    Please remember that this is still a pre-release, so back up everything before upgrading. If your project is making significant use of the Cinemachine 2.X API, think carefully before upgrading, it might be a lot of work. See our upgrade guide here.

    Installation
    Minimum Unity version: 2022.2.16f1
    Window -> Package Manager -> + -> Add Package By Name
    Name: com.unity.cinemachine
    Version: 3.0.0-pre.7

    Upgrading

    What's new in cinemachine 3
    Upgrade from cinemachine 2.X

    Changelog
    • Added CinemachineCore.GetCustomBlender and BlendCreatedEvent to allow custom blend behaviour.
    • New Custom Blends sample scene illustrating how to customize the blend algorithm.
    • CinemachineChannels can now be named via the CinemachineChannelNames asset. The OutputChannel struct has been removed.
    • Added CinemachineCameraManagerEvents behaviour.
    • Improved handling of nested blends.
    • Added the option of defining CINEMACHINE_NO_CM2_SUPPORT, to lighten the package by removing legacy CM2 support.
    • ThirdPerson Shooter sample scene now has an option to swap shoulders.
    • CinemachineCameraEvents and CinemachineBrainEvents and CinemachineCameraManagerEvents can be added to any GameObject, not only to the target objects.
    EDIT: 3.0.0-pre.7 is identical to 3.0.0-pre.6, only unit tests are slightly different.
     
    Last edited: Aug 23, 2023
  2. gg_michael

    gg_michael

    Joined:
    Sep 24, 2012
    Posts:
    73
    I have an issue with pre-release 7, but I don't see a thread for it yet so I'll put it here (upgraded from pre-4).

    After updating my blend is not functioning as expected. It's a default blend between 2 virtual cameras, nothing crazy. It is properly blending the ortho size and position, but NOT the rotation. The only thing I did was update from pre-4 to pre-7, and I had to update a few calls to
    Priority
    to
    Priority.Value
    to account for the API change. Is it expected that something like this could break with the recent blend updates? Thanks!
     
  3. Gregoryl

    Gregoryl

    Unity Technologies

    Joined:
    Dec 22, 2016
    Posts:
    7,720
    Blending logic has changed. The main change is how nested blending is handled (i.e. [[a to b] to c]). Can you show me what's happening, or better still, send me a repro scene?
     
    CiroContns likes this.
  4. Bryan-Legend

    Bryan-Legend

    Joined:
    Sep 8, 2012
    Posts:
    80
    I'm having an issue with this build.

    Cinemachine brain on a split screen camera will throw the exceptions shown in the screen shots and will not recover. I have to restart the game or that player will always be unable to rotate.

    It's something to do with CinemachineRotationComposer and happens when a player dies and respawns (teleports) and the camera was "inside a block" according to one of my playtesters.

    upload_2023-7-27_21-53-19.png

    upload_2023-7-27_21-56-43.png

    Please tell me how to fix or should I just wait for a new build. It seems like we are due for a new build.
     
  5. Bryan-Legend

    Bryan-Legend

    Joined:
    Sep 8, 2012
    Posts:
    80
    Here's the line 220 where the warning is being raised: upload_2023-7-27_22-1-53.png
     
  6. Gregoryl

    Gregoryl

    Unity Technologies

    Joined:
    Dec 22, 2016
    Posts:
    7,720
    This is very interesting. Can you isolate it in a repro project and send it to me?
     
  7. Bryan-Legend

    Bryan-Legend

    Joined:
    Sep 8, 2012
    Posts:
    80
    I can not. I can't even reproduce it reliably. Tends to happen every 10 minutes or so when a player respawns.
     
  8. batteryyrettab

    batteryyrettab

    Joined:
    Sep 20, 2013
    Posts:
    7
    Is there a reason why the m_Speed field has been omitted from the CinemachineSplineCart.cs? It was a really useful feature in the CinemachineDollyCart.cs? I'm certainly be adding the functionality back in - just wondering why Unity Technologies omitted it. The comments in the new version even allude to speed.
     
  9. Gregoryl

    Gregoryl

    Unity Technologies

    Joined:
    Dec 22, 2016
    Posts:
    7,720
    What do you mean "inside a block"?
     
  10. Gregoryl

    Gregoryl

    Unity Technologies

    Joined:
    Dec 22, 2016
    Posts:
    7,720
    It's still there, you just have to enable it in the the Automatic Dolly section. It's done this way in order to support alternate auto-dolly algorithms.

    upload_2023-8-2_14-18-26.png
     
  11. Bryan-Legend

    Bryan-Legend

    Joined:
    Sep 8, 2012
    Posts:
    80
    Sorry, I meant that I suspect the CinemachineDeoccluder is active and dollying forward when the player respawns and teleports and causes the bug.

    I'm also setting the axis values on teleport, which could be related:

    Code (CSharp):
    1.         public void Goto(Vector3 position, Quaternion rotation)
    2.         {
    3.             if (DebugLogging)
    4.                 Debug.Log($"Player {Number} Goto {position}, {rotation.eulerAngles}");
    5.             Movement.Motor.SetPositionAndRotation(position, rotation);
    6.  
    7.             var orbit = GetComponentInChildren<CinemachineOrbitalFollow>();
    8.             if (orbit != null)
    9.             {
    10.                 orbit.VerticalAxis.Value = orbit.VerticalAxis.Center;
    11.                 orbit.HorizontalAxis.Value = rotation.eulerAngles.y;
    12.             }
    13.         }
     
  12. batteryyrettab

    batteryyrettab

    Joined:
    Sep 20, 2013
    Posts:
    7
    Thanks for that :)

    Clearly my mistake.

    FYI: I appreciate the changes made, and all those involved in the re-development who have made it. Having the various options and settings as separate components and removing the m_ naming certainly gets my tick of approval.

    Cinemachine and Splines are my go to packages for a lot of what I do now. Having them work more closely is great.
     
  13. Gregoryl

    Gregoryl

    Unity Technologies

    Joined:
    Dec 22, 2016
    Posts:
    7,720
    I've been trying to repro your issue, but can't make it happen.
    Have you tried setting vcam.PreviousStateIsValid = false when you teleport the player? What happens if you add that?