How to make sprite go in front of and behind other sprites

I

ItsRiley

Guest
I am working on a project where players can move in all directions. I can't seem to figure out how to make it so when the character walks in front of another sprite they appear in front of it but when thye walk behind it they are behind. I tried adjusting the hitboxes but still the character is either in front or behind depending on who is on top of the layer. Anyone know how to fix this?
 
O

Old School Ben

Guest
The way I did it was by changing the depth of an object in the step event if the Y was greater than the player avatar.
 
Top