- Home /
Can i make an Object A appear always in front of an object B, but have an object C both in front of A and behind B?
So that's a little confusing so let me explain:
I have a bunch of indicators that are simply skinned planes, which I use to help the player aim his attacks.
I have the player and all other enemy entities.
And lastly I have my terrain where they all sit
Is it possible to make all the indicators appear always over the terrain, and all the enemies and player appear always over the indicator, but make the terrain block the enemies or player when needed?(e.g. if they are behind a hill) Edit: Hope you find the image clarifies this
Well that's confusing for me also. i simply don't understand what are you trying to do. Can you give a diagram or your script so i can understand your problem. I want to solve your problem but can't do it without complete information
Yeah it would be nice if you drew a picture of some sort describing what you're trying to achieve. I think I get the idea but I would like to be sure.
I think i understand what you are trying to achieve. To render top of another object it must have bigger rendering queue number, so it renders after other: Player > indicator > terrain and player. The problem is that that player and terrain need to be rendered same time to hide each other when needed and same time only player rendered top of the indicator. I didnt wrote this as an answer because i have no idea how to achieve this...
Seems like you would be fine having the indicator always on top of the terrain. And just moving the entity either at the very back or foreground...
Entity (Background): Layer -1
Terrain: Layer 0
Indicators: Layer 1
Entity(Foreground): Layer 2