• Hey Guest! Ever feel like entering a Game Jam, but the time limit is always too much pressure? We get it... You lead a hectic life and dedicating 3 whole days to make a game just doesn't work for you! So, why not enter the GMC SLOW JAM? Take your time! Kick back and make your game over 4 months! Interested? Then just click here!

SOLVED Access instances from another room?

Neptune

Member
Is this possible? It seems like it would be, but I can't seem to get it to work...
GML:
layer_set_target_room(not_current_room);

    var elements = layer_get_all_elements("Instances");
    for (var i = 0; i < array_length(elements); i++)
    {
        var node_inst =  layer_instance_get_instance(elements[i]);
        with(node_inst)
        {
               //assess creation code
        }
    }
    elements = noone;
                                                     
layer_reset_target_room();
[EDIT]
Hmmm it returns a real instance ID, but the instance doesnt actually exist so it seems . access and with() wont work šŸ¤”
variable_instance_get returns undefined

So close, but I think it's a no-go šŸ˜­
 
Last edited:
Top