Search Unity

  1. Unity Asset Manager is now available in public beta. Try it out now and join the conversation here in the forums.
    Dismiss Notice

Tilemap disappears

Discussion in '2D Experimental Preview' started by danbrani, Jun 23, 2017.

  1. danbrani

    danbrani

    Joined:
    Nov 22, 2012
    Posts:
    46
    The tilemap disappears at certain setups, which can be seen in the video:


    Increasing the far plane doesn't help. I've attached a project, if you move the camera a bit forward on the Z axis, the tilemap will disappear.

    Any clue how I can fix it? Is this something being worked on?
     

    Attached Files:

  2. DDaddySupreme

    DDaddySupreme

    Joined:
    Jun 3, 2017
    Posts:
    10
    I was having some problems with my tilemap randomly disappearing in certain spots or showing the wrong image a while ago, right after I'd finished making my brush script so I thought it was that. Not sure if it's the same problem you're getting, but I just deleted the grid and tilemap entirely then recreated them and never saw the problem again
     
    Infinite-3D likes this.
  3. danbrani

    danbrani

    Joined:
    Nov 22, 2012
    Posts:
    46
    Thanks for help!
    I set the tiles procedurally, recreating the map at the start always. After reading your suggestion I tried painting a 2D map myself and then just rotated it so it matches the plane of the procedurally created map, it doesn't disappear. Not sure how to use this info to solve the problem yet. I tried swizzling the grid of my procedurally generated map and then rotating it back to its initial position, but that didn't help.

    Again if sb from the 2D team or anyone else could confirm it a bug or that I've got some settings messed up it'd mean a lot.
     
  4. danbrani

    danbrani

    Joined:
    Nov 22, 2012
    Posts:
    46
    I checked this more thoroughly now, the bounds of the tilemap are calculated well, and the tiles placed on the XY axis do not disappear.

    tilemap_disapp.png

    Setting the rendering mode between chunk and and individual doesn't change anything. HEEELP!
     
  5. Tyrfingur

    Tyrfingur

    Joined:
    Mar 21, 2013
    Posts:
    7
    Hey danbrani, you need to change the tilemap setup, with the current setup you are not able to draw in the desired direction. Change the Tilemap Orientation back to XY and the Transform Rotation to (90,0,0), now you can draw in the desired direction.
     
  6. danbrani

    danbrani

    Joined:
    Nov 22, 2012
    Posts:
    46
    Hi Tyrfingur, thanks for help!

    This makes the tilemap visible along the XZ axis, but as the camera and character go higher, again the same problem occurs.

    Basically since I use the tilemap in 3D setting, I need it to stay visible no matter what direction it extends in.

    Is there any way I can change the visibility of the tilemap, make it visible at all times or something like that? I know this is not performant, but until this gets solved it'd be something.

    Please help. :(
     
  7. Tyrfingur

    Tyrfingur

    Joined:
    Mar 21, 2013
    Posts:
    7
    Try doing a test by painting the level by hand. I painted the tiles with different Z value and everything is rendering correctly, check out the Coordinate Brush in example project PreviewR401.
    I think you should also look into the rotation of the tile, then you can have the same rotation/orientation for both tilemaps or you could draw the floor/walls on the same tilemap.

    I wouldn't recommend using the tool for 3D level setup.
     
  8. danbrani

    danbrani

    Joined:
    Nov 22, 2012
    Posts:
    46
    Hey Tyrfingur,

    Drawing the tiles manually unfortunately doesn't change anything.

    I could draw both floor and wall tiles on the same tilemap, if I made the tilemap two times denser and anyway appropiately transformed them by type, but anyway both kinds disappear - the wall tiles and the floor tiles, this is not really a problem.

    This bug is the only issue that would prevent me from recommending the tilemaps for a 3D setup, these are very robust and even allow for animated tiles. A 3D setup for a top-down game with 2D graphics is not anything new, it makes so much more sense to setup things this way instead of faking 3D with a 2D tilemap and layers.

    DodgeRollGames team of Enter the Gungeon fame did it that way too:
    https://twitter.com/dodgerollgames/status/593625936131653632

    Thanks!
    At this point I'm fairly confident that it's a bug, so hoping it'll get resolved soon. Submitted the bug report with example project and a link to this thread.

    If anybody's interested, the bug's status can be found here: https://fogbugz.unity3d.com/default.asp?926828_sdblb4d6ki92oonf
     
  9. Tyrfingur

    Tyrfingur

    Joined:
    Mar 21, 2013
    Posts:
    7
    Hey danbrani, I setup a project with the settings I wrote about earlier, see the attachment.

    With 3D setup and moving the character higher I thought you were talking about moving the character on all 3 axis, but if you are going for something similar to Enter the Gungeon I do think this would be a great tool.

    There seems to be some kind of an issue with tiles at certain depths with the camera rotated, see the stairs in scene "Testo", but if you are only going for a depth of 2 you should be fine.
     

    Attached Files:

  10. danbrani

    danbrani

    Joined:
    Nov 22, 2012
    Posts:
    46
    I am going for the character moving on all 3 axes, and I am going for the height bigger than 2 tiles :) anyway it's the same idea just extended a bit and everything works well except for that disappearing issue...

    I'm just going to wait for the confirmation that this is something that gets addressed, I'm not sure what I'll need to do if it'll get "by design" or "won't fix" label.

    Thanks again!
     
  11. VincentiusIV

    VincentiusIV

    Joined:
    Nov 14, 2016
    Posts:
    4
    Managed to resolve the issue by changing "Detect Chunk Culling Bounds" to Manual, and the "Chunk Culling Bounds" to some high value (in my case I needed 10000 for each axis).

    I am guessing that when rotating the tilemap by 90 degrees on the X axis, the automatic detection of chunk culling bounds is still in the XY direction, and will cull the tile map with a slight deviation on the Z axis (since normally that would mean the camera is behind the tilemap, and thus it would not need to be rendered anymore).

    Also, make sure you are not using more than 1 tilemap. I was able to reproduce this same issue when duplicating mine, even with the changed chunk culling bounds. Hope this helps.
     
    jaqkk, UnDenya and Santako like this.
  12. Dilien

    Dilien

    Joined:
    Mar 15, 2020
    Posts:
    1
    Thanks! fixed my problem :D
     
    VincentiusIV likes this.