Author Topic: [SOLVED] Problem with colliders' depth...  (Read 4414 times)

Gregzo

  • Jr. Member
  • **
  • Thank You
  • -Given: 0
  • -Receive: 0
  • Posts: 64
    • View Profile
[SOLVED] Problem with colliders' depth...
« on: August 29, 2012, 02:25:58 AM »
Hi!

Here's my problem : I need to sort the depth of overlapping colliders in the same panel. Trouble is, the colliders aren't attached to sprites, so no way to change the depth property. Tried all sorts of Z-eding around, nope.

Anyone can help?

Cheers,

Gregzo

P.S. : Because of nesting, I can't add the collider to the sprite itself (structure : parentObjWithCollider->childrenSprites)
« Last Edit: August 29, 2012, 03:28:10 AM by Gregzo »

Gregzo

  • Jr. Member
  • **
  • Thank You
  • -Given: 0
  • -Receive: 0
  • Posts: 64
    • View Profile
Re: [SOLVED] Problem with colliders' depth...
« Reply #1 on: August 29, 2012, 03:30:24 AM »
Solved :

I was confused because adjusting the z of panels follows the "greater the z, further away" rule, but adjusting the z's of colliders in a panel follow the opposite rule (just like sprites' depth property).

I'm sure there's a good reason, but I doubt I'm the only one to have lost some time on that one...

ArenMook

  • Administrator
  • Hero Member
  • *****
  • Thank You
  • -Given: 337
  • -Receive: 1171
  • Posts: 22,128
  • Toronto, Canada
    • View Profile
Re: [SOLVED] Problem with colliders' depth...
« Reply #2 on: August 29, 2012, 09:17:22 AM »
Unity's Z coordinate, negative means closer to the camera.

MaxUylings

  • Newbie
  • *
  • Thank You
  • -Given: 1
  • -Receive: 0
  • Posts: 23
    • View Profile
Re: [SOLVED] Problem with colliders' depth...
« Reply #3 on: September 26, 2012, 06:12:23 AM »
Hey Gregzo,

Thanks for this post it has probably saved me a couple of hours. :)

Kind Regards,
Max