Author Topic: 2 cameras, 2 panels, but incorrect order on the raycasts  (Read 1730 times)

Tatanan

  • Jr. Member
  • **
  • Thank You
  • -Given: 11
  • -Receive: 0
  • Posts: 81
    • View Profile
    • Casual Arena
2 cameras, 2 panels, but incorrect order on the raycasts
« on: June 25, 2015, 10:38:58 AM »
I have 2 UI Roots, with 2 panels and 2 cameras.
Each "team" has different layer, the panels has different depth and the culling masks are assign to the corresponding layers.

It was supposed that a panel with bigger depth will be catch the raycasts (click events) first, wasn't it?

Instead the sprites on the layer with smaller depth and on the panel with smaller depth receive the click before the elements in the bigger depth.
I mean, the sprite which I see above on the Game is not the one which receive the click, even if this game has the collider and so on.

What am I doing wrong? The visual depth and collider depth is not the same?

Thank you.
Game developer on Casual Arena.

ArenMook

  • Administrator
  • Hero Member
  • *****
  • Thank You
  • -Given: 337
  • -Receive: 1171
  • Posts: 22,128
  • Toronto, Canada
    • View Profile
Re: 2 cameras, 2 panels, but incorrect order on the raycasts
« Reply #1 on: June 25, 2015, 09:19:25 PM »
It goes by camera depth first, then by panel depth, then by widget depth.

Tatanan

  • Jr. Member
  • **
  • Thank You
  • -Given: 11
  • -Receive: 0
  • Posts: 81
    • View Profile
    • Casual Arena
Re: 2 cameras, 2 panels, but incorrect order on the raycasts
« Reply #2 on: June 26, 2015, 08:21:55 AM »
It's not working exacly this way to me. I'll analyze deeper what's going on and tell you if I can't fix it.
Thank you
« Last Edit: June 26, 2015, 08:33:43 AM by Tatanan »
Game developer on Casual Arena.