Layering Objects in Top Down Plane

I need help, What I’m trying to do is change the layer of objects in my top down game based on Y level, if an object is below another than make it go to this y level. How do I do this?

NOTE: this would be easy, but I’m creating objects and there are multiple of the objects I’m trying to compare, how do I specify which instance I’m checking?

There is already an extension to do that. Its called Y-Sort.
[Steps to get it]
image


image
image

image

Thx for the help.

I know how to add extensions tho.

I’ll check it out when i get a chance