0 votes

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)

in Engine by (369 points)

1 Answer

0 votes
Best answer

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.

by (10,523 points)
selected by
Welcome to Godot Engine Q&A, where you can ask questions and receive answers from other members of the community.

Please make sure to read Frequently asked questions and How to use this Q&A? before posting your first questions.
Social login is currently unavailable. If you've previously logged in with a Facebook or GitHub account, use the I forgot my password link in the login box to set a password for your account. If you still can't access your account, send an email to [email protected] with your username.