instance_id_get


Description

With this function you can get the unique ID value of any instance from the currently active instance list. You give the index in the instance list to get the ID from and the function will return the value for storing in a variable.


Syntax:

instance_id_get(index);

Argument Description
index The index within the instance list from 0 - (instance count - 1).


Returns:

Instance ID value (real)


Example:

for (var i = 0; i < instance_count; i ++;)
    {
    var temp_id = instance_id_get(i);     with (temp.id) speed += 0.1;
    }

The above code will loop through all instances within the room and add 0.1 to their speed.