Get INstance Count Icon Get Instance Count

With this action you can find the number of instances of any given object currently active within the room. You can select any object from the resource list or you can use the special keyword all to get the number of all the instances active. You also need to supply a target variable to return the value to so that you can then use it in further actions. If you flag the target variable as "Temp" then this will create a new temporary (local) variable to hold the return value for you, as shown in the example below.

 

Action Syntax:

Get Instance Count Action

Arguments:

ArgumentDescription
ObjectThe name of the object to check for.
TargetThe variable to target for the return value.

 

Example:

Get INstance Count ExampleThe above action block code creates a local (temporary) variable and then assigns the number of instances of the object "obj_Squirrel" to it. This value is then checked and the instance is destroyed if the number of instances is greater than 100.