Attention | Topic was automatically imported from the old Question2Answer platform. | |
Asked By | Schweini |
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?
Attention | Topic was automatically imported from the old Question2Answer platform. | |
Asked By | Schweini |
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?
Reply From: | Jowan-Spooner |
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.