Search Unity

  1. Welcome to the Unity Forums! Please take the time to read our Code of Conduct to familiarize yourself with the forum rules and how to post constructively.
  2. Dismiss Notice

Question Jitter with Freelook Camera?

Discussion in 'Cinemachine' started by AerionXI, Jul 7, 2022.

  1. AerionXI

    AerionXI

    Joined:
    Jul 20, 2020
    Posts:
    482
    So what is up with my Cinemachine Jittering like this when I want to smoothly move up and down the terrain?

    Here's what it is doing :



    Here's my FreeLook Settings :



    Any help is absolutely appreciated!

    Thank you!
     
  2. AerionXI

    AerionXI

    Joined:
    Jul 20, 2020
    Posts:
    482
    Can someone help me please? Thank you!
     
  3. AerionXI

    AerionXI

    Joined:
    Jul 20, 2020
    Posts:
    482
    Do I need to explain better? If so, please let me know! Thanks!
     
  4. Gregoryl

    Gregoryl

    Unity Technologies

    Joined:
    Dec 22, 2016
    Posts:
    7,233
    There is a known issue in Unity Editor whereby the framerate is very unstable when a transform inspector is visible. This is editor-only and the build should be perfectly smooth. Try testing with the inspector panel closed. Do you still have the jitter?
     
  5. AerionXI

    AerionXI

    Joined:
    Jul 20, 2020
    Posts:
    482
    @Gregoryl still getting a little bit of jitter.

     
  6. Gregoryl

    Gregoryl

    Unity Technologies

    Joined:
    Dec 22, 2016
    Posts:
    7,233
    Can you send me the project?
     
  7. AerionXI

    AerionXI

    Joined:
    Jul 20, 2020
    Posts:
    482
    @Gregoryl Well. I would, but it has assets I purchased from the asset store... Envirosky, etc.
     
  8. Gregoryl

    Gregoryl

    Unity Technologies

    Joined:
    Dec 22, 2016
    Posts:
    7,233
    If you can make a simple repro project without those assets, it would be better
     
  9. AerionXI

    AerionXI

    Joined:
    Jul 20, 2020
    Posts:
    482
  10. AerionXI

    AerionXI

    Joined:
    Jul 20, 2020
    Posts:
    482
  11. Gregoryl

    Gregoryl

    Unity Technologies

    Joined:
    Dec 22, 2016
    Posts:
    7,233
    Thanks for the project.

    I'm able to see the jitter when the player is moving very fast towards the camera and the terrain is not flat. If you turn off the CnemachineCollider, the jitter goes away, so that is probably the source.

    Thinking about it, I suspect the the problem comes from the fact that the terrain is not a smooth surface - it is tessellated - so when the player is moving quickly it is going over the sharp bumps created by the tessellation, and that makes the camera bump.

    upload_2022-7-9_9-23-16.png

    It's a difficult problem to solve, and I'm not sure it can be solved 100% in this situation, since the CM collider works by doing raycasts, and the raycasts hit the tessellated shape.

    I was able to smooth it out a fair bit by tweaking the collider settings like this:

    upload_2022-7-9_9-25-4.png

    Also, I would recommend enabling Interpolation on your player, it will give better performance:

    upload_2022-7-9_9-26-15.png
     
  12. AerionXI

    AerionXI

    Joined:
    Jul 20, 2020
    Posts:
    482
    @Gregoryl : Thank you for doing that. This is a real problem because I absolutely NEED the camera collider.
     
  13. centaurianmudpig

    centaurianmudpig

    Joined:
    Dec 16, 2011
    Posts:
    91
    If the tessellated geometry is the problem try a smoother collider just for the camera where needed to get around it.
     
  14. AerionXI

    AerionXI

    Joined:
    Jul 20, 2020
    Posts:
    482
    i do believe the terrain uses the terrain collider.
     
  15. AerionXI

    AerionXI

    Joined:
    Jul 20, 2020
    Posts:
    482