New version of Cinemachine 3 pre-release 4 available

Hello everyone :)! We’ve just published a new version of Cinemachine 3.0.0. Make sure to back up your beautiful projects before installing. Especially if upgrading from a 2.x.x version.

Let us know what you think.

Enjoy!

Installation

Minimum version: 2022.2.5f1
Window → Package Manager → + → Add Package By Name
Name: com.unity.cinemachine
Version: 3.0.0-pre.4

Upgrade guide

Upgrade from cinemachine 2.x

Changelog
Added

  • Progress bar added to Cinemachine Upgrader.
  • CinemachineDeoccluder is a new class, not just a rename of CinemachineCollider.
  • CinemachineAutoFocus extension is now available for built-in and URP pipelines, with reduced functionality compared to HDRP.
  • Camera.focusDistance is driven by CM when the camera is in physical mode.
  • Confiner2D provides API to adjust the confiner to the current window size when the lens or aspect changes.
  • TargetGroup now ignores members whose gameObjects are inactive.
  • Cinemachine Samples can import their package dependencies.
  • CinemachinePathBase search radius fixed for not looped paths.
  • Add SplineAutoDolly.ISplineAutoDolly.Reset() method and SplineAutoDolly.Enabled flag.
  • Confiner2D and Confiner3D support smooth stop at bounds edge.
  • URP: add temporal effects reset on camera cut.
  • Add Weight setting to CinemachinePostProcessing and CinemachineVolumeSettings.
  • GroupFraming also works on LookAt target.
  • Several new Sample scenes were added.

Changed

  • Improved performance of CINEMACHINE_EXPERIMENTAL_DAMPING algorithm.
  • Path gizmo drawing was optimized.
  • Confiner2D does less gc alloc.
  • CinemachineSmoothPath is upgraded to Splines correctly now.
  • InputAxis refactor for recentering and momentary axis support.
  • CinemachineIndependentImpulseListener renamed to CinemachineExternalImpulseListener.
  • CmCamera is now CinemachineCamera.
  • The SimpleFollowWithWorldUp binding mode has been renamed to LazyFollow.
  • CinemachineExtension API changes to VirtualCamera, GetAllExtraStates, OnTargetObjectWarped, and ForceCameraPosition.
  • Third person shooter sample use object pooling for the projectiles.

Deprecated

  • CinemachineConfiner is deprecated. New behaviour CinemachineConfiner3D to handle 3D confining. Use CinemachineConfiner2D for 2D confining.
  • 3rdPersonFollow and 3rdPersonAim are deprecated and replaced by ThirdPersonFollow and ThirdPersonAim respectively.

Fixed

  • Regression fix: POV and PanTilt handle ReferenceUp correctly.
  • Bugfix: Lens blending was wrong.
  • Bugfix: CinemachineDeoccluder Pull Forward strategy only pulls forward even with Camera Radius bigger than 0.
  • Bugfix: Extensions were not respecting execution order on domain reload.
  • Bugfix: AxisState was not respecting timescale == 0.
  • Bugfix: priority ordering was wrong when the difference between any priority values were smaller than integer min or bigger than integer max values.
  • Bugfix: Very occasional axis drift in SimpleFollow when viewing angle is ±90 degrees.
  • Bugfix: Physical lens settings were not being properly applied.

8815060--1199542--Screen Shot 2023-02-17 at 1.25.png

6 Likes

That looks really good!
Seems like some nice new functionality and general improvements.
Great samples too, I’m especially happy with the good practices being shown, such as using Object Pooling in them.

I would, however, like to request the addition of a shoulder-swap feature to the “ThirdPerson Shooter” 3D Sample.
Doing so would not only bring the sample closer to what’s used in production but would also provide a valuable jumping-off point for game developers looking to create high-quality third-person shooter games, maybe it’s a feature they hadn’t even considered yet.

Here’s a list of some great titles that use it, the only modern third-person game I can think of that doesn’t have it is Fortnite, but that could’ve been a conscious choice to change tactics or discourage peeking.

It’s a feature that’d be especially helpful to show to devs that are looking to create third-person cover shooters, those types of games always have the feature.

Overall, great additions!
Keep it up

3 Likes

@Walter_Hulsebos Great suggestion for the shoulder swap. We love getting feedback, that’s the whole point of pre-releases. Keep it coming!

2 Likes

A feature I have in my custom Orbit-Camera and missing in Cinemachine:

For example when you are in a dense forest with very thin trees, you don’t want the camera to find a new position every time, because this is very stressful to look at and also destroys the feeling that you are hiding or sneaking.

So a feature to ignore thin colliders when they are further away than distance x would be very helpful.

I can remember that trees set with unity terrain engine could not be distinguished from the terrain itself. This problem I have solved by checking the angle: when closer to the ground the colliders are not ignored, because this might be the terrain ground, when looking “quite straight” forward the tree colliders have been ignored.

2 Likes

Interesting idea. Looks like some features of the deoccluder can’t be used with terrains. Will see if we could give a better solution for that.

One thing you could do in your case is using layers. It is possible to exclude layers with the Transparent Layers field on the deoccluder component. Assign the trees prefabs you want to be excluded to this this layer. Then in your Terrain settings set Preserve Tree Prototype Layers to true.

Your deocluder settings

Your tree prefab

You terrain settings
8824444--1201303--Screen Shot 2023-02-21 at 2.29.png
Let us know if this could work for you.

Thanks for the feedback.

Thank you for this detailed answer!

If this doesn’t cut through the object with the camera, but just ignores it if it’s in front of the camera, then this is exactly the needed feature to switch from my custom solution to cinemachine.

I wanted to test it, but I get the following errors. Tested with Unity version 2021.3.19f1, complete empty project, just imported cinemachine, default RenderingPipeline.

Library\PackageCache\com.unity.cinemachine@3.0.0-pre.4\Runtime\Core\LensSettings.cs(196,53): error CS1061: ‘Camera’ does not contain a definition for ‘focusDistance’ and no accessible extension method ‘focusDistance’ accepting a first argument of type ‘Camera’ could be found (are you missing a using directive or an assembly reference?)

Library\PackageCache\com.unity.cinemachine@3.0.0-pre.4\Runtime\Behaviours\CinemachineBrain.cs(1057,29): error CS1061: ‘Camera’ does not contain a definition for ‘focusDistance’ and no accessible extension method ‘focusDistance’ accepting a first argument of type ‘Camera’ could be found (are you missing a using directive or an assembly reference?)

Minimum Unity for CM3.0 is 2022.2.5f1.

Cinemachine 3.0 is not showing in my package manager. Any ideas why?

EDIT: I see now I have to “Add package by name”
IMO this should be documented. The official docs make it seem like it is available in the package manager and does not indicate this extra step Upgrading a Project from Cinemachine 2.X | Cinemachine | 3.0.1