Making a Z order system: Adding a layer system

2

Tagged

Stats

1,361 visits, 2,455 views

Tools

Translations

This tutorial hasn't been translated.

License

This tutorial is licensed under CC BY 4.0. Please refer to the license text if you wish to reuse, share or remix the content contained within this tutorial.

In this tutorial we are going to build up from the beginner tutorial and write a slightly more complex system. This new system will allow to set up virtual layers for the Z order, allowing objects to stay on top even if other objects have a larger Y coordinate.

We will take the same ZOrder family as the previous tutorial. We will add a new variable named “layer” next to the “order” variable. This “layer” variable will host the layer number the object will be on.

We will now extend the beginner code to account for this new change.

That way, the order variable for higher layers will be higher than that of lower layers. LayoutHeight is only used as an arbitrary large value. If you have objects outside the layout boundaries, and/or are using unbounded scrolling, you might want to give it a larger number to avoid weird issues.

Next Tutorial In Course

Making a Z order system: Moving the player across layers 03:31

In this third part, we move the player across layers, and make it amazing.

  • 0 Comments

  • Order by
Want to leave a comment? Login or Register an account!