You are not logged in.
Pages: 1
Since instance_number also counts childrens, here it's version which checks exactly for object type:
/// @desc returns number of instances of given object type, without it's childs
/// @param object_id int
var __total = 0;
with (argument0) {
if (object_index == argument0) __total++;
}
return __total;
Offline
Oh, this is a good idea for a script. I've never really considered if instance_number()
includes descendants. That behavior is not documented.
Abusing forum power since 1986.
Offline
It will be documented in next release of GMS2, as I reported this as bug, seeing it includes descendants. The reply was to create a script like above instead of fixing function
Offline
Pages: 1