2D Toolkit Forum

2D Toolkit => Support => Topic started by: jakecattrall on May 21, 2013, 10:53:13 pm

Title: [SOLVED]Tilemap layers Z index issue
Post by: jakecattrall 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:
(http://img593.imageshack.us/img593/7744/lgt3a08.png)

Here's how it looks in unity:
(http://img59.imageshack.us/img59/9548/lgtf5d9.png)

Here is how it's supposed to look:
(http://img825.imageshack.us/img825/1188/lgtccc7.png)
Title: Re: Tilemap layers Z index issue
Post by: unikronsoftware 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.
Title: Re: Tilemap layers Z index issue
Post by: jakecattrall 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.
Title: Re: Tilemap layers Z index issue
Post by: unikronsoftware 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.
Title: Re: Tilemap layers Z index issue
Post by: jakecattrall 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.

(http://i.imgur.com/b5pL9jM.png)
Title: Re: Tilemap layers Z index issue
Post by: unikronsoftware on May 22, 2013, 09:11:01 pm
Is your main camera perspective by any chance?
Title: Re: Tilemap layers Z index issue
Post by: jakecattrall on May 23, 2013, 06:10:18 pm
Yup, changing to orthogonal fixed the issue. Thanks!