Zorgan
Zorgan

Reputation: 9173

Unity GameObject rendering below GameObject lower in the hierarchy

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.

enter image description here

enter image description here

Why is this?

Upvotes: 0

Views: 592

Answers (1)

Andriy Marshalek
Andriy Marshalek

Reputation: 276

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)

Upvotes: 1

Related Questions