I have a GameObject (TopSquare) that is rendered after PlayButton
in the hierarchy, yet the PlayButton
is showing on top. This goes against Unity's rule of objects added last are shown over objects added previously.
Why is this?
CodePudding user response:
The square is a sprite that is an object in the World, while the button exists in the UI layer over it.
You have to use UI Image for black square instead of sprite renderer (Right-click on parent -> UI -> Image)