So, is there a built-in function to GDScript where I can pause a process in a script for a few seconds, say:
wait(1) #waits for 1 second
set_visible(true) #then continues the rest of the script after the 1 second wait
var t = Timer.new()
Don't forget to free the timer afterwards, or you'll cause a memory leak.
See OS.delay_msec and OS.delay_usec.
Note that if you use those in the main thread, those will cause the project to freeze until the delay has expired.
Does the timer created here get disposed?
I believe that, once the routine has been resumed, the SceneTreeTimer object, returned by the create_timer () function, becomes invalid, as documented at: