0

I have a 2D Unity (2022.3.5f1) project it contains a camera, canvas and the TMPro UI elements are components of childs of the canvas. The problem is that these components are (when active) visible through other UI like sprites (I checked the sprites are on top from the z-coordinate).

I changed the shader of the TMPro components to every other shader but none of them helped fixing the problem. I ran out of ideas what I can try.

basic example of button that is visible through white square

Thanks for your help!

derHugo
  • 83,094
  • 9
  • 75
  • 115
  • Depends on the settings of the items. – BugFinder Aug 05 '23 at 13:53
  • What settings do you mean so that I can provide you with them or edit them but thank you for your effort beforhand. – not_actually_finn Aug 05 '23 at 16:42
  • For UI items the order is always according to the Hierarchy (lower elements appear on top = are rendered last) .. If I would have to guess based on your screenshot I would say your hierarchy has the red panel on the top, the white below, the button below and finally the text below the button. – derHugo Aug 07 '23 at 11:29
  • @derHugo thanks for your explanation. It helped regarding TMPro components laying over each other but TMPro components are still laying over Sprites like in the picture. – not_actually_finn Aug 07 '23 at 13:21
  • your sprites are `UI.Image` or `SpriteRenderer`? .. in general if your Canvas is `Screenspace - Overlay` it will always be on-top of anything else in your scene – derHugo Aug 07 '23 at 13:23
  • The Canvas is Screenspace-Camera and the sprites are SpriteRenderer. Do I **have to** change the canvas to overlay? – not_actually_finn Aug 07 '23 at 17:02

0 Answers0