Using "await" in a loop only functions once

The _process() function is a callback that will be called each frame. it won’t stop the processing of the node if you await inside it.

If you want to stop the processing of the node until the await signal is fired then you can try something like this:

func _process(delta: float) -> void:
	set_process(false) # Stop the _process() function
	await get_tree().create_timer(1).timeout # wait 1 second
	set_process(true) # start again the _process() function
	print("hello")
2 Likes