Search Unity

  1. The 2022.1 beta is now available for testing. To find out what's new, have a look at our 2022.1 beta blog post.
    Dismiss Notice

Bug CinemachineVirtualCamera Damping and Smoothing not working

Discussion in 'Cinemachine' started by SimonsCat, Nov 19, 2021.

  1. SimonsCat

    SimonsCat

    Joined:
    Mar 11, 2015
    Posts:
    43
    Hi,

    We are testing the Cinemachine Example Scenes from the Cinemachine Package.

    We opened the 3rdPersonWithAimMode sample scene and set 2 parameters of the Cinemachine Collider extension:
    - Strategy to Pull Forward Camera
    - Damping to 10

    As you can see in the video, the camera does some sort of damping but the camera moves instantly back and smoothing sideways at the same time. The expected behavior is to preserve the direction and smooth the trasition backward to the original distance set.



    The second bug captured is the Smoothing time... we set the smoothing time to 2 seconds but the camera ignores this setting and starts to bull back the camera immediately... this feature worked as expected in CM 2.7.9



    Is this behavior expected?
     
    Last edited: Nov 19, 2021
  2. Gregoryl

    Gregoryl

    Unity Technologies

    Joined:
    Dec 22, 2016
    Posts:
    5,558
    No, these behaviours are not expected. We will look into them. Thanks for bringing it up.
     
  3. Gregoryl

    Gregoryl

    Unity Technologies

    Joined:
    Dec 22, 2016
    Posts:
    5,558
    We could repro the smoothing problem but not the damping thing. What version of CM are you using?
     
  4. SimonsCat

    SimonsCat

    Joined:
    Mar 11, 2015
    Posts:
    43
    We used Unity 2020.3.18f1 and CM 2.8.2... we noticed this in our production scene first, when we tried to setup the VC, then we reproduced the same in a completely empty project, loading just the CM sample scenes.

    btw.. we also noticed that the smoothing worked only once, the first time the camera needed to do the smoothing and then not anymore. The dumping thing is quite consistent and we did not notice that it would work under certain conditions. When testing try to rotate the camera quickly and set the damping time to max so you can observe the movement slowly.
     
    Last edited: Nov 29, 2021
  5. Gregoryl

    Gregoryl

    Unity Technologies

    Joined:
    Dec 22, 2016
    Posts:
    5,558
    Thanks for the description. We have fixed the smoothing bug,

    The damping is behaving as expected for this setup. Why don't you use the 3rdPersonFollow rig instead? It has its own built-in collider that is designed specifically for 3rdPerson cameras. Have a look at the AimingRig sample.
     
  6. SimonsCat

    SimonsCat

    Joined:
    Mar 11, 2015
    Posts:
    43
    Hi Gregoryl,

    I waited for the new Cinemachine release and retested the cameras. (CM 2.8.4, Unity 2020.3.25f1, Standard Pipeline)
    I created a new empty project and imported the CM Samples. No other code added except default Unity packages.

    To test the Cinemachine Collider Extension I opened the "3rdPersonWithAimMode" Scene.
    1. Disabled the Noise component on the VC "CM 3rdPerson Normal" (set to none)
    2. Changed the CM Collider Strategy property to "Pull camera forward"
    3. default parameters for smoothing time and damping left on 0

    Everything looks ok and seems to work normal.

    4. Changed Smoothing time to 2 and Damping to 10 (exaggerated values to see better the behavior)

    PROBLEM 1:
    When I exit the collision with the nearby wall the smoothing now works every time (not just the first time)... I always see the 2 sec delay before the camera pulls back to a proper distance... however, the pulling back feature is the thing that is broken.
    The Pull camera forward strategy means that the camera gets pulled forward, towards the point the camera is looking at, in front of the collider that obscures the camera view. Right? This part seems ok.
    When I rotate the camera out of the collision, the VC waits 2 sec (as it is set) and then starts to pull back to the original distance... also seems fine, BUT if you rotate the camera (Aim POV) DURING the pull back phase, let's say for another 90 deg, the bull back direction stays locked in WORLD SPACE and the camera starts floating sideways. Looking in the right direction, but moving to the side instead of moving backward, away from the look point.

    PROBLEM 2:
    Another thing to mention: If I set the smoothing time and the damping time, there is a glitch/camera shaking every time I rotate the camera out of collision. The shaking happens only if I rotate the camera the whole time after the camera leaves the collision and before the smoothing time expires and the camera starts to pull back. Then the shaking stops. If the smoothing and damping values are = 0 then there is no shaking.


    We want to use this kind of camera for the free look walking camera, because it has all the features we need and the expected behavior is exactly what we are looking for. And for the actual Aim/Shooting camera we are using the camera you suggested - 3rdPersonFollow rig.
     
    Last edited: Dec 27, 2021
  7. Gregoryl

    Gregoryl

    Unity Technologies

    Joined:
    Dec 22, 2016
    Posts:
    5,558
    Why not use 3rdPersonFollow rig for both cameras? What does this camera do that the 3rdPersonFollow does not?
     
unityunity