Expression: Get Object (within scene) VIA string

Is it possible to get an object via a string?

For example; You have a REPEAT event that is ran 10 times with each loop adding +1 to a _object_loop scene variable.

Within this repeat event you’re running an action to update the X position of object_b_X to object_a_X (X being a number from 1 to 10) if the current variable of object_b equals the _object_loop variable.

(All object_b_X’s are put into an Object Group called grp_of_object_b)

So it would look like THIS

Instead of something like THIS

I know it’s not the greatest example of what I am asking but I hope it gets the point across.

I don’t think this is something I can do with JS as a function as I can’t return an object, just a string and number (AFIAK).

Object names are references and not strings, and therefore cannot be selected dynamically in that way via events, as far as I know.

You might be able to build an object list that way via JS, but we’d need someone who is more experienced with GDJS to chime in.

1 Like

Sorry, this should have been in the Feature Request section not the “How Do I” that’s my bad Silver. (Updated)