+1 vote

Hey Guys,
I have four scene with same mesh/object in four different colors.
Now, in a another scene i randomly instance any of the four scene as a child to a node in the scene every one second using a time timeout function and play animation for the instanced scene.
My Question is how do i free or delete the scene i instanced after the animation is finished playing or delete it before a new instance is made(in my case every one second)
Please Help.

in Engine by (55 points)

1 Answer

0 votes

you can use the queue_free() method.

just a pseudo-code here:

if myObjectAnimationfinished():
queue_free()

note that animations have a signal called finished (I could be entirely wrong). Hope this helps!

by (104 points)
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.