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
  3. Join us on November 16th, 2023, between 1 pm and 9 pm CET for Ask the Experts Online on Discord and on Unity Discussions.
    Dismiss Notice

Question Z-Fighting Occurs at play and disappears after I collision

Discussion in '2D' started by Almost73, Jun 17, 2023.

  1. Almost73

    Almost73

    Joined:
    Apr 28, 2023
    Posts:
    8
    I have a strange issues with Z-Fighting, I have those lines on the ground layer however they are not through the whole ground layer, only in some areas. The appear an flicker as soon as I press play, however the strange thing is that, after I move the character into a wall (or anything with collision) for like 1 second, they disappear completely and everything is fine. I literally have no idee why it has this strange behaviour. Because its not on every map. There are scenes in which I used the same tiles on ground layer and the flickering lines do not appear at all, even if the area is relatively small or big. lines.PNG
    I searched everywhere and found nothing about it.
     
  2. karderos

    karderos

    Joined:
    Mar 28, 2023
    Posts:
    376
    create sprite atlas and set padding = 2
     
  3. MelvMay

    MelvMay

    Unity Technologies

    Joined:
    May 24, 2013
    Posts:
    10,620
    As above, that doesn't remotely look like Z-fightning but more like texture (sprite) padding not there.
     
  4. Almost73

    Almost73

    Joined:
    Apr 28, 2023
    Posts:
    8
    And to change the padding can be done only with sprite atlas? Is there any other way? (I am pretty new in Unity)
     
  5. karderos

    karderos

    Joined:
    Mar 28, 2023
    Posts:
    376
    yes you can add manually but if you are new its added auto with atlas