Hello
I'd like a feature, which enables me to set a family or objects z-index based on its current Y-axis.
Like, every tick, it simply sets the z-order index to its Y-axis integer.
Atm, I am using a single devoted for each loop on one family (Zorder) sorting it by Y, moving all the family objects to the top as it loops, giving me a nice fluid z-ordering of my dynamic and static objects all in 1 go.
However, this thing alone sucks up a roughly ~9% of total cpu power usage on the profiler tab.
Seeing as the rest of the game totals up to ~22%, I consider my z-order method to be a bit hoggish.
I think that having something native in an object, which can simply set its z-order index to its Y-axis number every tick, could save quite some cpu. Perhaps a Z-order behaviour.
This is not the first time I ran into this issue relating to z-ordering, and did not find a better approach, if there is a better method to do z-ordering, I'd love to hear it.