Works perfectly well until I try to change or reload current scene. Then it returns this error: “Resumed function _process() after yield, but class instance is gone”.
Is there any simple workaround?
I honestly like the simplicity of yield(get_tree().create_timer(time),"timeout")
Is there a method maybe to control it?
Just made a simple one myself. In case somebody needs it:
var startCounter = false #starts counting when true
var wait = 3.7 #you want your stuff in how many seconds
var a = 0 #counter variable
func _process(delta):
#here you set the time limit (customize to your needs)
#by setting startCounter to false, you reset timer
if startCounter == false:
a = 0
else:
if a < 10:
a += 1 * delta
#start the counter and do your stuff when counter equals your desired wait time
#set startCounter to true or false to your needs
startCounter = true
if wait >= a:
#do your stuff here