#With statement question

1 messages · Page 1 of 1 (latest)

feral rivet
#

When using with statement for loop on all instances of an object.
In which order are they looped? By their creation order? By their depth? Anything else?

twilit matrix
#

seems to be highest to lowest id

I just did 'with (obj) show_debug_message(id)' and got this

#

@feral rivet

#

created more objects and tried, and yeah it just goes from highest to lowest id

feral rivet
#

Seems that then it's by their creation order

twilit matrix
#

yeah, I tried to also check layers and it would still sort by id.

#

I guess if you need it to be by layer you can do multiple checks of with

fading pollen
#

this is not reliable behavior, btw

#

with() technically loops backwards through the instance ids, so the opposite way of normal code execution. but this is not documented and should not be relied upon