Search code examples
c#unity-game-engine2dtopdown

sprites order in unity


I'm new to these kinds of stuff so my question may seem a bit easy to you: how I can order sprites in Unity for a top-down game using C#? I mean, I should set their Z value equal to their Y value or something?


Solution

  • Your game will work in the 2 dimension space following the X and Y coords. If you want to setup special ordering for your sprites, yes you can use the transform component attributes. By lowering the Z component, sprites will appear behind others.

    You should read the doc and try by yourself before asking this type of question, it is pretty straightforward and easy to test. Here is the link to the doc you could need :

    https://docs.unity3d.com/Manual/2DSorting.html