Reputation: 27
I currently have a scene set up in Unity2D where sorting layers of any kind have no effect at all.
I start with 3 panels on the screen (attached to a canvas). The panels have some images as children. Then I position them such that there is some overlap between them. From there I attach a Sorting Group component to them, and then run my game.
From there I've tried everything I can think of to alter the sorting layers and have one of the back panels appear at the front but to no avail. I've tried altering the Sorting Group layers, the Unity layers, and the Z position.
What am I doing wrong?
Upvotes: 2
Views: 3265
Reputation: 914
I believe Sorting Group is a UI component. It's used for parent game objects of sprite children.
What you want is to add the "Canvas" Component (Not to be confused with the main UI canvas) to each of your panels. Then make sure Override sorting is checked. Then put a number in for the order. Larger numbers are in front of smaller numbers.
Upvotes: 5