Hello Guest

Author Topic: [SOLVED]Tilemap layers Z index issue  (Read 6596 times)

jakecattrall

  • Newbie
  • *
  • Posts: 6
    • View Profile
[SOLVED]Tilemap layers Z index issue
« on: May 21, 2013, 10:53:13 pm »
The layers are there, I can see them when I select the tile render data, but they seem to be behind/inside the base layer.

My map is imported from TMX.

These are my TileMapData settings:


Here's how it looks in unity:


Here is how it's supposed to look:
« Last Edit: May 23, 2013, 06:30:50 pm by jakecattrall »

unikronsoftware

  • Administrator
  • Hero Member
  • *****
  • Posts: 9709
    • View Profile
Re: Tilemap layers Z index issue
« Reply #1 on: May 22, 2013, 12:11:40 pm »
The tilemap system simply imports the layers in the order they appear in the file. It doesn't mess about with the layer order.

Once you've imported, expand the Layers foldout, and use the "D" and "U" buttons on the layers to reorder them correctly. You'll only need to do this once, subsequent imports will simply update into the correct layers.

jakecattrall

  • Newbie
  • *
  • Posts: 6
    • View Profile
Re: Tilemap layers Z index issue
« Reply #2 on: May 22, 2013, 01:39:58 pm »
As you suggested, I used the U/D buttons and sorted the layers by ascending and descending but the result is the same for both.
The U/D buttons make no visible difference to anything.

I'll grab a screenshot when I get home.
« Last Edit: May 22, 2013, 01:48:41 pm by jakecattrall »

unikronsoftware

  • Administrator
  • Hero Member
  • *****
  • Posts: 9709
    • View Profile
Re: Tilemap layers Z index issue
« Reply #3 on: May 22, 2013, 04:34:48 pm »
Please do. Also, I think there is a bug with the current version of tk2d where one of the offsets gets 0'ed when reordered. Make sure the z offsets have some positive values in there before committing. Eg 0.01 in each should do the trick.

jakecattrall

  • Newbie
  • *
  • Posts: 6
    • View Profile
Re: Tilemap layers Z index issue
« Reply #4 on: May 22, 2013, 09:03:17 pm »
Thanks for the quick responses!

See the screenshot below.
At no point during the layer reordering does anything change on the scene/game view.


unikronsoftware

  • Administrator
  • Hero Member
  • *****
  • Posts: 9709
    • View Profile
Re: Tilemap layers Z index issue
« Reply #5 on: May 22, 2013, 09:11:01 pm »
Is your main camera perspective by any chance?

jakecattrall

  • Newbie
  • *
  • Posts: 6
    • View Profile
Re: Tilemap layers Z index issue
« Reply #6 on: May 23, 2013, 06:10:18 pm »
Yup, changing to orthogonal fixed the issue. Thanks!