Browse Source

Merge pull request #54077 from Duroxxigar/scenetreetimer-example

Update example code for SceneTreeTimer to reflect new await keyword
Rémi Verschelde 3 years ago
parent
commit
9f22ea2a76
1 changed files with 1 additions and 1 deletions
  1. 1 1
      doc/classes/SceneTreeTimer.xml

+ 1 - 1
doc/classes/SceneTreeTimer.xml

@@ -10,7 +10,7 @@
 		[gdscript]
 		[gdscript]
 		func some_function():
 		func some_function():
 		    print("Timer started.")
 		    print("Timer started.")
-		    yield(get_tree().create_timer(1.0), "timeout")
+		    await get_tree().create_timer(1.0).timeout
 		    print("Timer ended.")
 		    print("Timer ended.")
 		[/gdscript]
 		[/gdscript]
 		[csharp]
 		[csharp]