Search Unity

Question Sprite glitch on Game tab

Discussion in 'General Discussion' started by XIIl_, May 19, 2023.

  1. XIIl_

    XIIl_

    Joined:
    Jul 21, 2021
    Posts:
    24
    Hi!

    Basically i have a animation that works normal on scene tab and get some glitches on game tab. The vídeo below can explain better.



    This is the first time this happens, i worked in the same way in all the others animation, with same setup of
    câmeras, etc.

    In the game tab, you can see there is a gap next to his neck, like the position or something is nothing right.


    Someone have a suggestion that what's this can be? Thank you!
     
  2. CodeSmile

    CodeSmile

    Joined:
    Apr 10, 2014
    Posts:
    6,005
    It may be a seam issue that happens due to floating point imprecision during rendering. But this can only occur if these two pixels belong to different textures. Are they?

    If so, check into "pixel perfect" rendering for Unity. I believe there is even a package for that, mainly for tilemaps which often have this particular issue where you'd see thin lines at the borders of rectangular tiles.

    It could also be related to the texture's settings, specifically if it's a texture atlas you will want to make sure there is at least a 2px padding around textures and filtering is turned off for all of them. There may be other tricks involved, can't remember as it's been nearly 10 years that I've last worked with 2d pixel art games.