![]() |
Attention | Topic was automatically imported from the old Question2Answer platform. |
![]() |
Asked By | nagne |
I want to make code delaying time not using “timer node”. So is there codes in gdscript?
![]() |
Attention | Topic was automatically imported from the old Question2Answer platform. |
![]() |
Asked By | nagne |
I want to make code delaying time not using “timer node”. So is there codes in gdscript?
![]() |
Reply From: | zhyrin |
OS.delay_msec(<value>)
![]() |
Reply From: | putper |
You can use OS.delay_msec
, but do read the disclaimer below it. It pauses the entire thread, possibly freezing your entire project.
In Godot 4 you can delay your code like so:
# wait 2 seconds
await get_tree().create_timer(2).timeout