Have you looked into using a Timer
? Set the Timer
to "One shot", then assign its timeout()
signal to some script (such as the sprite's script). Set the signal function (the one that's usually called _on_timer_timeout()
) to either hide the sprite, or free it completely. The function would look like this:
# In the sprite script.
func _on_timer_timeout():
# Either call this function or hide()
queue_free()