One idea would be to make a variable called time_left
, and decrement it in _fixed_process
by delta
. After it is less than zero, call the function you want.
Another way would be to use a Timer
node, and its timeout
signal:
timer.connect("timeout", self, "queue_free")
timer.set_wait_time(1)
timer.start()
A third way would be to use the Tween
node, which has some quite versatile uses...
tween.interpolate_callback(self, 1, "queue_free")
tween.start()