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. We have updated the language to the Editor Terms based on feedback from our employees and community. Learn more.
    Dismiss Notice

Bug Jittering in build

Discussion in '2D' started by arti32lehtonen, Mar 10, 2023.

  1. arti32lehtonen

    arti32lehtonen

    Joined:
    Jan 3, 2022
    Posts:
    2
    Hi!

    I have a problem with the jittering in my game when my camera is moving. The interesting thing is that the problem is barely visible in play mode or WebGL build, but it is very noticeable in the windows build.

    All three videos (and screenshots of my camera inspectors) are here:
    https://drive.google.com/drive/folders/1_ZHbWFE-kY3ifdqzumwKsfOSQs-MG-i-?usp=sharing

    I am using cinemachine, a pixel-perfect camera. My character movement is inside FixedUpdate. I tried to play with the cinemamachine Smart Update / Late Update settings. I also tried to use my own camera mover, but it didn't solve the issue.

    I saw a lot of similar issues, but none of them was helpful. As it doesn't appear in the WebGL build, I hypothesise that something is wrong with my build settings. Could someone suggest what I need to do?
     
  2. MelvMay

    MelvMay

    Unity Technologies

    Joined:
    May 24, 2013
    Posts:
    10,621
    FixedUpdate runs, well, at a fixed update by default 50hz. I can only presume (because you don't say) that you're doing this in FixedUpdate because you have a Rigidbody2D and are moving it with its velocity or MovePosition and you're using interpolation.
     
  3. arti32lehtonen

    arti32lehtonen

    Joined:
    Jan 3, 2022
    Posts:
    2
    Yes, you are right. All of my character movement happens inside FixedUpdate. Yes, I am using RigidBody2D and interpolation. I am using velocity for my movement. I tried to use MovePosition as well, but get the same jittering as before.

    I thought that Rigidbody2D was the right way to do the movement. Actually, I don't have any physics in the game except the movement.