Delete instanced Nodes

:information_source: Attention Topic was automatically imported from the old Question2Answer platform.
:bust_in_silhouette: Asked By Godot_Starter

Is there a way to delete every per code instanced nodes in the scene at once?
(I already now that I can delete a single Instance via queue_free, but I want to delete every Instanced Node with one code)

:bust_in_silhouette: Reply From: njamster

No, there isn’t. However, you can use a container, let’s say a node of type “Node2D” and add all your instanced scenes as children of this container. Then when you want to free all of them together, you’d just ‘‘queue_free()’’ the container-node and it’s children will get freed automatically as well.