Author Topic: object Z-orders on screen  (Read 1846 times)

superp

  • Newbie
  • *
  • Thank You
  • -Given: 0
  • -Receive: 0
  • Posts: 14
    • View Profile
object Z-orders on screen
« on: September 20, 2014, 02:34:21 AM »
I am writing 2d game.
In my scene, at the bottom, i have NGUI panel depth 1 and have a few buttons.
On top of that i have Unity's game object with animator that plays animation. it is in NGUI's panel with depth 2.
On top of that, i have NGUI's panel depth 3 that sometimes serve as pop up. It shows a sprite with message.

The problem i am having is that the panel's depth doesn't seem to apply to the animator object. it is always shown on the top of other panels.

Is there a way to make Unity game object to follow the panel depth order?
thanks

ArenMook

  • Administrator
  • Hero Member
  • *****
  • Thank You
  • -Given: 337
  • -Receive: 1171
  • Posts: 22,128
  • Toronto, Canada
    • View Profile
Re: object Z-orders on screen
« Reply #1 on: September 20, 2014, 09:29:20 AM »
Which camera is it seen with? For depth to function they must all be drawn using the same camera.

superp

  • Newbie
  • *
  • Thank You
  • -Given: 0
  • -Receive: 0
  • Posts: 14
    • View Profile
Re: object Z-orders on screen
« Reply #2 on: September 20, 2014, 06:36:11 PM »
there is only one camera and all objects are at the same layer

ArenMook

  • Administrator
  • Hero Member
  • *****
  • Thank You
  • -Given: 337
  • -Receive: 1171
  • Posts: 22,128
  • Toronto, Canada
    • View Profile
Re: object Z-orders on screen
« Reply #3 on: September 21, 2014, 09:05:47 AM »
Make sure the event type is of UI type, like 3D UI. if it's 3D World then it's not going to be based on Depth.