I had a similar problem calling a function which sorts zOrder after an object was created. The function would sort everything except the created sprite, even though the function picked all. Function is top level event, bug or by design?
On colission
-> Create Sprite
-> call function
function picks all. sorts z-order.
did not work. the newly created object is not sorted with the rest.
On created (new top level event)
-> call function
function picks all. sorts z-order.
did not work. the newly created object is not sorted with the rest.
I can't get the created sprite to sort with the rest of the objects, even after calling a function.
wait 0 works but creates ugly unsorted graphics glitch for a fraction of a secondbefore it's sorted correctly.