Pulse Works Studio

Parse Error: Identifier "yield" not declared in the current scope.

yield is not a function in Godot 4. Waiting is the await keyword.

Cause

GDScript 2 removed yield(). The parser treats the word as an ordinary identifier, then fails because nothing in scope has that name. Idle-frame waits, timers, and signals all use await.

Fix

func flash() -> void:
	modulate = Color.WHITE
	await get_tree().create_timer(0.08).timeout
	modulate = Color(1, 1, 1, 1)

func wait_for_ready(node: Node) -> void:
	if not node.is_node_ready():
		await node.ready

Related

Godot Dev Tools is a Pulse Works Studio project. All error explainers.