0 votes

So, I cloned a Fish Sprite with this code:
var Fish = Fish1.instance() FishClone = add_child(Fish)
How can I let the clone(s) disappear?

in Engine by (232 points)

1 Answer

0 votes

Hey Schweinl,
you could do it inside the script of your fish. Deleting a nod is done with queue_free(). You can do the same from everywhere else too, in case your fish doesn't have a script.

But your code looks strange. You are probably not doing FishClone = add_child(Fish). At least there is no sense in it. add_child() returns nothing so FishClone is empty.

Hope it helps.

by (864 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.