How to Dynamically Handle Being Behind or in Front of Objects - Unity Tutorial #2

preview_player
Показать описание
In this tutorial, you will learn to setup a custom axis to make objects in the same order layer appear behind or in front of your player based on the position. This is much more efficient than changing the order in layer as the player moves. This will make it so when your player is in front of something, it shows that objects behind. But when the player moves behind that object, it shows in front.

Unless you want to always be in front or behind something ( in that case you'd use order in layer ), you want to use the custom axis so that will change depending on your position and the object's position.

---

Subscribe for game making tutorials with unity and to follow my projects with the dev logs ! Follow me on tiktok for small clips @MaxMakesGames

Рекомендации по теме
Комментарии
Автор

I can't believe how simple the solution is. Thank a lot !

OmniCroissant
Автор

I've been researching this for so long, you just took the stress away and now I feel pretty confident in making an isometric game!

I thought I had to make a dynamic script on all objects that would be pretty inefficient, thanks so much!

ryanwinchy
Автор

Thank you, I had an issue adding a guitar to a model.

bashymumbles
Автор

This saved me bro thank you so much. Been trying to figure this out for a few hours

herminator
Автор

thanks a lot bro so simple and straight to point love ya thanks

prathameshpradhan
Автор

No way it was this easy, I will test it out soon. Great video!

KevalDeepak
Автор

Muchas gracias, era algo tan fácil ! 🖤

Una cosa, si su personaje tiene varios SpriteRenderer y con diferentes orden de sort, no sirve, debe ser todo el personaje en sort 1 y por ejemplo el arbol también debe ser sort 1.

SlaveObeysOficial
Автор

o my god im gonna try this tmrw. hopefully it still works

RMDK
Автор

thank you so much, you saved my project haha

giusper
Автор

And this is that easy? I thought I have to create tree in two layers or write dynamic script. This is awesome!

theashenone
Автор

Just dont forget that they have to be on the same sorting layer or this wont work

charmeager
Автор

Great video, love it, so simple! Glad you didn't code it hahaha

GrumpyIdiot