Search Unity

Question 3D object between UI panels shows up on top of the panel it should be hidden under

Discussion in 'UGUI & TextMesh Pro' started by Damotr_, May 30, 2023.

  1. Damotr_

    Damotr_

    Joined:
    Nov 6, 2021
    Posts:
    3
    There are two panels. One as moved back by Vector3(0f,0f,10f) - it moved it nearly 700 units in world space (no idea why it works like that).

    There is 3D object build from multiple cubes in between panels. If certain cube is closer that half the distance it's shown above closer panel, if it half or more: show under.

    Canvas is set to Screen Space - Camera.


    Editor view:


    Play view:


    My question is: why it works like that, and how to fix it?
     
  2. Damotr_

    Damotr_

    Joined:
    Nov 6, 2021
    Posts:
    3
    Okay, probably I found answer and it is fact, that in UI (for some reason even Screen Space - Camera) order of rendering things is based on rounded percent of position between two panels.
    Hope I'm wrong...