instance_id

Returns the id of an instance in the room.

Syntax:

instance_id[0 ... n];


Returns: Real


Description

This read only array holds all the ids of every active instance within the room. This means that if you have used any of the instance_deactivate functions those instances that have been deactivated will not be included in this array (if you have used a value from this array previously, it will now return the keyword noone).


Example:

var i;
for (i = 0; i < instance_count; i += 1;)
   {
   with (instance_id[i]) speed += 0.1;
   }

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


Back: Instance Functions
Next: instance_count
© Copyright YoYo Games Ltd. 2018 All Rights Reserved