Hello Guest

Author Topic: Chunk z-position disparity  (Read 4733 times)

danthat

  • Newbie
  • *
  • Posts: 4
    • View Profile
Chunk z-position disparity
« 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 :)

unikronsoftware

  • Administrator
  • Hero Member
  • *****
  • Posts: 9709
    • View Profile
Re: Chunk z-position disparity
« Reply #1 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;

danthat

  • Newbie
  • *
  • Posts: 4
    • View Profile
Re: Chunk z-position disparity
« Reply #2 on: October 07, 2016, 11:58:59 am »
Ah, am amazing. Thank you :)

d