Search Unity

Question Cinemachine camera 'woble' when rotating the virtual camera's target fast

Discussion in 'Cinemachine' started by mrboembastic, Oct 15, 2021.

  1. mrboembastic

    mrboembastic

    Joined:
    Oct 31, 2014
    Posts:
    14
    Hi Unity Community!

    I've got a problem with a cinemachine camera setup and I don't know what's causing the issue.

    The best way to describe the issue is with a video of the undesired effect:



    I rotate the cinemachine virtual camera around my player by rotating that camera's lookAt target. The problem here is that when rotating fast the camera does a 'woble' effect instead of a smooth streamlined rotation that is expected. I checked the values in the inspector and the target as well as the camera is only rotated on one axis so that doesn't seem to be the issue. You can see in the video that the yellow center marker of the camera moves down as I rotate fast, which probably points to the cause of the issue but I can't figure out the solution.

    Any help would be greatly appreciated!
     
  2. Gregoryl

    Gregoryl

    Unity Technologies

    Joined:
    Dec 22, 2016
    Posts:
    7,712
    Yes I can see it. What version of Cinemachine are you using, and can you show an image of your vcam inspector?
     
  3. mrboembastic

    mrboembastic

    Joined:
    Oct 31, 2014
    Posts:
    14
    Unity version 2020.3.17f1
    Cinemachine version 2.6.10 (also upgraded to latest 2.8.1 but doesn't fix the problem)



     
  4. Gregoryl

    Gregoryl

    Unity Technologies

    Joined:
    Dec 22, 2016
    Posts:
    7,712
    Thanks for the info, and sorry for the delay.
    I am unable to reproduce your issue with the same vcam settings. It rotates for me without wobble, even when I move the mouse very fast. I used the character controller from the AimingRig CM sample.
    Is it possible the the problem is in your character controller code?
    If you would like to put together a lightweight project that shows the problem, I can look at it.
     
  5. mrboembastic

    mrboembastic

    Joined:
    Oct 31, 2014
    Posts:
    14
    Thanks for taking a look, I think the problem is caused by the placing a Rigidbody on the main camera with interpolate on (that has the Cinemachine brain on it)

    The reason I placed the rigidbody with interpolate in the first place is because otherwise objects childed to the camera will stutter when moving the camera.

    So what would be right setup so objects don't stutter when attached to the camera if I can't add a rigidbody with interpolate?
     
  6. Gregoryl

    Gregoryl

    Unity Technologies

    Joined:
    Dec 22, 2016
    Posts:
    7,712
    Objects that are rigidly parented to the camera will never stutter when the camera is moved. You don't need the RigidBody for that.
     
  7. mrboembastic

    mrboembastic

    Joined:
    Oct 31, 2014
    Posts:
    14
    Having a rigidbody attached to the camera with interpolate, fixed the problem of a stuttering effect when following a moving target. (Navmesh agent with rigidbody)

    So removing it fixes the one problem but brings back the old one.
     
  8. Carpe-Denius

    Carpe-Denius

    Joined:
    May 17, 2013
    Posts:
    842
    Try changing the update method on your brain to smart update, that worked for me when dealing with differently sourced motions.
     
    Gregoryl likes this.
  9. Gregoryl

    Gregoryl

    Unity Technologies

    Joined:
    Dec 22, 2016
    Posts:
    7,712
    You'll have to go into more detail about the nature of the stuttering objects. If they were truly parented to the camera, then they would absolutely 100% stay in the same screen spot no matter how the camera moved - unless they themselves were being interpolated. Perhaps there is a better way to stop the stuttering.