A
A
Andrew2020-05-29 12:12:18
C++ / C#
Andrew, 2020-05-29 12:12:18

How to move the player through the layers in a 2d game?

Hello, I need to do layer navigation in Unity.
For example, like in Hyper Light Drifter, where I could go behind this column.
5ed0d1b04b32d603498154.jpeg
At the moment I'm trying to do this:
The higher the Y, the smaller the layer and vice versa. The only problem is that I don't know how to change the layer parameters in the code itself.
But if I'm stupid and you can do better than the way I'm trying (I'll have to scatter NPCs and map elements in layers), then I'll be glad to see how to do it right.

Answer the question

In order to leave comments, you need to log in

1 answer(s)
M
mopsicus, 2020-05-29
@mopsicus

Sprite Renderer has a Sorting Layer option

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question