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?

asked Jun 16, 2019 in Engine by Schweini (234 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.

answered Jun 17, 2019 by Jowan-Spooner (758 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 How to use this Q&A? before posting your first questions.