Screen shots of how problem happens would be helpfull. That happens probaly bcs building y isnt in wright spot.I use depth=-y; to make player object go behind if little bit behind a enemy or building. Depth=0; makes it work but if player place meeting with building then it's go under building. My game is 2D top down game. Like isometric games.