Custom Sort Axis
Last updated
Last updated
In 2D games we generally want to sort sprites along the Y axis. So we want to have objects that are below to render on top of the ones that are higher up. This can be achieved by playing around with the Sprite Renderer Order in Layer values, but we can also configure Unity to sort sprites and objects along the Y axis automatically if we want to:
If you are using URP you can change this option in the Pipeline Renderer asset (if you set the sorting axis to the Z axis sprites will get sorted by depth, this is used in 2.5D and 3D games):