You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository was archived by the owner on Jul 30, 2023. It is now read-only.
Returns all currently loaded instances of a particular object
Syntax
<RValue>GetObjectInstances(
<real>MasterID
);
Parameters
MasterID
Type: Real
The master ID of the object. Refer to the GetAssetID function to get possible values.
Return Value
Type: RValue
An array of RValues, containing instance IDs of all instantiated objects.
You can use this ID with GameMaker functions like instance_destroy.
Example
localid=GetAssetID("obj_savepoint"); -- Get the master ID of obj_savepointlocalinstances=GetObjectInstances(id.realval); -- Get all the instances of itforindex=1, #instancesdolocalv=instances[index]; -- Loop over all the instances print("Loaded Instance ID: " ..v.realval) -- Print their IDs to the consoleend