gdscript remove deleted objects from array code example
Example: gdscript remove deleted objects from array
for object in array:
if ! is_instance_valid(object):
array.erase(object)
for object in array:
if ! is_instance_valid(object):
array.erase(object)