Search Unity

Cinemachine Inconsistent Jitter

Discussion in 'Cinemachine' started by CasualDutchman, Jul 11, 2021.

  1. CasualDutchman

    CasualDutchman

    Joined:
    Jan 20, 2016
    Posts:
    37
    My Setup:
    I am using a Target Group to track local players. (Using Unity's Input System's PlayerInputManager)
    The VCam does not rotate, only follow the target group.
    The player uses a rigidbody to move around.

    The problem:
    When the brain and target group's update method are set to Smart and Late update, the world moves smoothly but the player jitters around.
    When both are set to the fixed update method, the player moves smoothly, but the world jitters.
    Both are true by turning the player's interpolation to Interpolate or none.

    I have searched a lot with this problem and I have not found a solution I'm happy with.
    I would like both the player and the world to move smoothly.

    Even using 2 cameras where the players are rendered with a different overlay camera and vcam, the result is inconsitent. (With a setup of 2 cameras, 2 vcams. 1 pair shows the world, the other only the players)
    When showing the player on both cameras, the player's camera seems to render with a slight delay. This probably has to do with the fact 2 vcams can do slightly different things.
    Also, the shadows of the players are not rendered.

    Can anyone suggest a fix?

    Versions:
    Unity: 2020.2.7f1
    Cinemachine: 2.7.4
    URP: 10.3.2 (Not sure if this is relevant)
     
    Last edited: Jul 11, 2021
  2. Gregoryl

    Gregoryl

    Unity Technologies

    Joined:
    Dec 22, 2016
    Posts:
    7,719
    When the camera can smoothly follow either the world or the player but not both, this is usually a symptom of uneven animation of the player. In fact it's impossible to smoothly follow both in that situation. The solution is to animate the player smoothly. Can you give some details about how the player's transform is getting updated?
     
  3. CasualDutchman

    CasualDutchman

    Joined:
    Jan 20, 2016
    Posts:
    37
    That is sad to hear.
    I'm using a third party solution which sets the rigidbody.velocity
     
  4. Gregoryl

    Gregoryl

    Unity Technologies

    Joined:
    Dec 22, 2016
    Posts:
    7,719
    As I said, the solution is to animate the character smoothly. Perhaps you can log the velocity and graph it to see whether it's in fact being animated smoothly. If it's not, then you might have to fix the third party solution, or forego a jitter-free experience. If the animation is in fact smooth, then we will have to dig deeper and look elsewhere for the problem.