Search Unity

Bug Chunks seem to switch ordering or change size dynamically causing sprites to flash

Discussion in '2D' started by xtytyx, Jun 12, 2021.

  1. xtytyx

    xtytyx

    Joined:
    Dec 29, 2017
    Posts:
    24


    I am seeing an issue where the chunk sort order is being changed on the fly causing a flickering effect of sprites switching sort orders as i move around.
    I would think the intended behavior would be that the sort order on chunks is static on any chunked tilemap no matter where you are looking at it from.

    I have uploaded a video containing the tile map settings as well as its selection in the hierarchy
    If you have 2 tiles that overlap and the tilemap renderer is set to chunk, it seems like the chunks are either getting dynamically resized or a the sorting algorithm is unsure of what order to render the chunks in.
    Obviously this doesn't happen for individually sorted tiles.
    The other thing of note is that i have variably sized tiles because the artstyle of my game makes same size tiles unreasonable.
    I have submitted a bug ticket but just wanted some advice here as well.
     
  2. xtytyx

    xtytyx

    Joined:
    Dec 29, 2017
    Posts:
    24
    Another thing I have tried is:
    setting the chunk size manually with code, setting the cull distance to manual and auto
    neither of these changes made much of a difference, it changed where the chunks were changing but not that they were changing
     
  3. ChuanXin

    ChuanXin

    Unity Technologies

    Joined:
    Apr 7, 2015
    Posts:
    1,068
    Hi, could you post the case number of the bug ticket here? That would be helpful, thanks!
     
  4. xtytyx

    xtytyx

    Joined:
    Dec 29, 2017
    Posts:
    24
    @ChuanXin sure thing it is (Case 1342765)!!
    Let me know if you need any more info!!
     
  5. ChuanXin

    ChuanXin

    Unity Technologies

    Joined:
    Apr 7, 2015
    Posts:
    1,068
    Thanks! Will check it out!
     
  6. xtytyx

    xtytyx

    Joined:
    Dec 29, 2017
    Posts:
    24
    It turns out this has to do with them being in different textures, the way to handle this is to atlas your textures into a texture atlas, the problems disappear after that!
    in my case i had 2 separate tilemap textures making up that area!
     
    Jawsarn and Deeje like this.
  7. Jawsarn

    Jawsarn

    Joined:
    Jan 12, 2017
    Posts:
    245
    Thank you! Solved it for me as well. Having multiple tilemaps on top of eachother with different sort order in chunk mode caused invalid ordering when zoomed out too far.