- Home /
2.5d Perspective
I'm making a 2.5d game (so similar to this) and I was just wondering if it was possible to make it so that the player appear behind other sprites when moving behind them, and in front of them when they are moving in front of them.
The only way I can think of doing this is to have the sprites of each character split in two, with the top half on one layer, and the bottom half on another. This seems like a bit of effort to do for every character, so I was wondering if there would be an easier solution.
Check the answer given here : https://gamedev.stackexchange.com/questions/79655/angled-topdown-perspective-camera-for-2-5d-game
Answer by Bilelmnasser · Dec 07, 2017 at 09:59 AM
hi, change SortingLayer based On Player position to the tree : https://docs.unity3d.com/Manual/class-SpriteRenderer.html
sprite.sortingOrder = sortingOrder;
sprite.sortingLayerName = LAYER_NAME;
Thats a good way of doing it. What would be the best way of comparing the player's position though do you think? $$anonymous$$aybe just calculate it using OnCollisionEnter?
Look at this you will see how it's done : https://youtu.be/mcg-LINnEgg?t=748
Your answer
Follow this Question
Related Questions
2.5d Sorting Layers 0 Answers
Default Tags and Layers in Unity 1 Answer
Car Demo Question 1 Answer
How is click/touch input handled when using different layers? 3 Answers
Layers are colliding even though they are set to ignore each other 1 Answer