- Home /
How to properly handle render sorting in a Top-Down game with unity 2017.2 tilemaps?
Is it possible to be able to dynamically sort with tile maps? I am looking for a "Diablo-Like" wall effect where a player can walk in front of and behind a wall. In front of the wall they will be drawn on top of the wall, and behind they will be partially hidden by the wall.
I currently have it so that an objects order in they sorting layer is given by:
spriteRenderer.sortingOrder = -(int)(transform.position.y * depthPerYUnit);
This works well, and all things on the "Units" layer are rendering as they should. However I cant get it when dealing with multiple layers. In the Robo-Dash demo(https://github.com/Unity-Technologies/2d-gamedemo-robodash) they simply make it so that you can't go behind walls.
If you could imagine that the Robo-Character was able to go behind the wall with the wall visibility being modified so that you can still see the character that is the effect I want. Thanks!
Your answer
Follow this Question
Related Questions
Prefab to a tile script 0 Answers
2D: Transparency Sort Axis not properly affecting Tilemaps? 2 Answers
How to assign individual data to a tiles? (Unity3D Tilemap) 0 Answers
Tilemap edge-outline collider 1 Answer
Tilemap.hastile always returns false 1 Answer