Pulse Works Studio

Parse Error: Function "load_level()" is a coroutine, so it must be called with "await".

A function that awaits is a coroutine. Calling it without await is a parse error.

Cause

If load_level uses await, its result is a state object, not the level. The analyzer requires the caller to await it, unless the call is the entire statement and you intentionally ignore completion. Fire-and-forget is load_level.call() only when you mean that; otherwise await it.

Fix

func load_level() -> void:
	var packed := load("res://levels/01.tscn") as PackedScene
	await get_tree().process_frame
	get_tree().change_scene_to_packed(packed)

func _on_play_pressed() -> void:
	await load_level()

Related

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