-
Notifications
You must be signed in to change notification settings - Fork 0
Layers and layer manager
Nate River edited this page Oct 20, 2024
·
14 revisions
When there are multiple charactes on a scene, you may want to order them to overlap each other correctly.
LayerManager
component (custom) is attached to all characters. It contains Sprites
property that can be used to iterate over all sprites. It also contains a link to Sorting Group
component (built-in). Sorting Group
component is attached to Body
game object. You can use it to order characters, just change Order in Layer
.
If you want to order characters based on the Y-coordinate, use Sorting Group
as well. Create a custom script that will update Order in Layer
based on the Y-coordinate in Update
.