2D Toolkit Forum

2D Toolkit => Support => Topic started by: danthat on October 04, 2016, 11:34:54 am

Title: Chunk z-position disparity
Post by: danthat on October 04, 2016, 11:34:54 am
Hello! I notice Chunks have a tiny z-positon offset when a tilemap is built (-1e-06, -2e-06, and so on). This is causing some issues with Raycasting to an Edge Collider, as the ray is very specific.

Wondering 1. what the reasoning behind this is, before I break something by coding around it and
2. where in the code this is happening? I could happily reset the z-pos to 0 when a chunk is rebuilt, but I can't for the life of me find where the position is being reset/ changed!

Any help much appreciated :)
Title: Re: Chunk z-position disparity
Post by: unikronsoftware on October 06, 2016, 11:03:31 pm
Hi there,

The reason its there is to help with sorting when tiles overlap one another.
You can turn it off by commenting out line 380 in tk2dTileMapBuilderUtil.cs

Code: [Select]
tilePosition.z += z;
Title: Re: Chunk z-position disparity
Post by: danthat on October 07, 2016, 11:58:59 am
Ah, am amazing. Thank you :)

d