I am building this on an example that I got help with movement from chrilley. I now need to implement some sort of sorting so that when the character moves in front of the "counter" he is moved in front of it and when moving behind he is moved behind, but I am unsure what would be the best method to achieve this? I have uploaded an example of just the character and two counters, now one counter is always in front of him and the other behind him.

EDIT: Seems the Layer object did what I wanted