Sprite Jittering/Flickering

Hello everyone, I’m making a tower stack game and having this problem.

Whenever the camera move, you can see from the video that the tiles are jittering/flickering/moving.

I did some researches but didn’t solve it. Here are what I did:

  • Increase Pixels Per Unit. (There are some lines between tiles similar to Section 5 of Rick and this approach solve it, but not the problem above.)
  • Using Sprite Atlas. (I found some tutorials and used it but it didn’t solve the problem.)
  • Turn off anti-aliasing. (This seems work but it is not a completely solution, if you zoom closer, you can see the gaps/lines), you can see it here: https://www.youtube.com/watch?v=QW53YIjhQsA

This is the link to my record: https://youtu.be/paawTPL-NsE, sorry because I can’t post a video here.
Hope I can find a solution here, thank you for reading.

Hi PA1N, welcome to the community. The game screen in Unity is just a preview. It is frequently not as smooth and clean looking as the built game. Try building your game and see if the issue persists.

Thank you for you response but even when I tested with the build, it remained the problem.
https://www.youtube.com/watch?v=sMUgcPOddpE

After doing a couple of reseaches and tests, I have solved the problem. I will list some information that I think it would be useful.

The main problem is I used Vector3.Lerp to move the camera to the target position.

  1. Using Pixel Perfect Camera.
    This component would help solve the problem I mentioned above. However, using it with Vector3.Lerp causes the camera jittering when it moves closer to the target position.

  2. Using Vector3.MoveTowards instead of Vector3.Lerp
    This method would not make the camera have the “easing out” effect like Lerp, but it can also make the camera move smoothly.

You could combine both of them, but for me PPC might not help a lot.

Additonally, one problem remaining is the “house” sprite is still jittering due to Box Collider 2D Stacking (Physics 2D), which make the under boxes slightly move horizontally.

1 Like

This topic was automatically closed 24 hours after the last reply. New replies are no longer allowed.

Privacy & Terms