Search Unity

Black Horizontal lines

Discussion in '2D' started by TheRheanator, Dec 12, 2018.

  1. TheRheanator

    TheRheanator

    Joined:
    Nov 1, 2018
    Posts:
    4
    ive been having this problem where in the editor (and only the editor) i get these weird black horizontal lines on my tilemap, i had one project where i got rid of them but i cant duplicate it in this new project

    heres the settings i have

    and heres a close look, please help i cant find anything online
     

    Attached Files:

  2. RidgeWare

    RidgeWare

    Joined:
    Apr 12, 2018
    Posts:
    67
    That's completely normal - they're just the grid lines, which aid you in positioning tiles.

    You can choose to switch them on and off in the Gizmos tab above the scene window.
     
  3. TheRheanator

    TheRheanator

    Joined:
    Nov 1, 2018
    Posts:
    4
    It isnt, my grid is set to a gray color which you can see in the first picture, and these black lines are only going horizontal, i also know it isnt my grid because they dont cover the player sprite
     
  4. RidgeWare

    RidgeWare

    Joined:
    Apr 12, 2018
    Posts:
    67
    Actually looking closely at the sprite, both the horizontal and vertical lines do appear to cover the sprite, they just change to reflect the sprite colour underneath.

    What happens when you switch off the grid lines? Do both the vertical/horizontal lines disappear?
     
  5. TheRheanator

    TheRheanator

    Joined:
    Nov 1, 2018
    Posts:
    4
    like i said my grid is gray not black, when i turn off the grid it gets rid of the grays lines not the big black lines that are going horizontal
     
  6. RidgeWare

    RidgeWare

    Joined:
    Apr 12, 2018
    Posts:
    67
    Okay, that's the first time you've mentioned the lines are still there with grid lines switched off.

    In that case I'm unsure why horizontal lines would be showing in the scene view. Perhaps could be worth looking at the tiles themselves - the spritesheet should be set to Point instead of Bilinear for example.
     
  7. ljrobison

    ljrobison

    Joined:
    Feb 8, 2020
    Posts:
    5
    Sorry to bump this old thread but I am running into the exact issue you are. My in the Scene view, and only the scene view, are picking up a very small line (like way less than a pixel) at the bottom of each tile from the tile underneath it in the palette. It doesn't effect the actual game, but it is quite an eyesore and a pain when making new maps.

    It seems it's just a rendering issue with scene view or something, but I would really like to get this resolved so I don't have to use Tiled to make my maps and lose some functionality.

    I tried so much googling and only found this thread with the same issue. The rest were talking about the same issue, but in game, which is not the issue I'm having.

    Did you ever find a way to resolve this issue?

     
    Last edited: Feb 8, 2020
  8. Tom-Atom

    Tom-Atom

    Joined:
    Jun 29, 2014
    Posts:
    153
    Your tile image is not in sprite atlas, right?
     
  9. ljrobison

    ljrobison

    Joined:
    Feb 8, 2020
    Posts:
    5
    For me, originally no.
    I tried after adding them to the atlas and the same issue was still happening.
     
  10. Tom-Atom

    Tom-Atom

    Joined:
    Jun 29, 2014
    Posts:
    153
    Hmm.... try to change (increase) padding in atlas settings and also make sure mip-maps are not used.
     
  11. ljrobison

    ljrobison

    Joined:
    Feb 8, 2020
    Posts:
    5
    These are my current Atlas settings. I'm fairly new to Unity and never used the Atlas before so I could be doing something wrong.
    https://i.imgur.com/32q7s6d.png
     
  12. Tom-Atom

    Tom-Atom

    Joined:
    Jun 29, 2014
    Posts:
    153
    In fact, I am running out of ideas... Your settings look OK to me. Just try to change Padding from 4 to something else, but this value should be OK.
    In most cases, that lines (bleeding) you see are because GPU takes from one position by.
    Also check if anti-aliasing is off in Editor -> Project Settings -> Quality and also on camera.
    Try placing something under grid to see if it is grey color on tile or gery color of background (= transparent line). If it is transparent, then try to split your atlas into two - one for transparent objects and second for non-transparent things.
     
  13. ljrobison

    ljrobison

    Joined:
    Feb 8, 2020
    Posts:
    5
    Ive been through all that already haha. Its definitely a color from the tile below it in the tileset. Its just a rendering bug for the scene view I was hoping I could find a fix for. Thanks for the help though. I think I'm just going to have to used Tiled and lose some functionality with Unity sadly. I know the game view still looks fine, but the lines are really bothering me when designing maps.
     
  14. ljrobison

    ljrobison

    Joined:
    Feb 8, 2020
    Posts:
    5
    BrandyStarbrite and Tom-Atom like this.
  15. BrandyStarbrite

    BrandyStarbrite

    Joined:
    Aug 4, 2013
    Posts:
    2,076
    Aye, thanks for that info dude.
     
  16. C_R_E_A_T_R_O_R

    C_R_E_A_T_R_O_R

    Joined:
    Jun 21, 2017
    Posts:
    1
    What worked for me was setting the tilemap's wrap mode from repeat to clamp
     
  17. haqpod

    haqpod

    Joined:
    Feb 4, 2020
    Posts:
    14
    I had issues with black lines appearing when I zoomed in/out in my 2d top down game. Turning on pixel snap in the shader the tilemap objects are using seems to have solved it.