Pulse Works Studio

Parse Error: Function "instance()" not found in base PackedScene.

PackedScene.instance() was renamed to instantiate().

Cause

The analyzer knows the callee is a PackedScene and that instance is not one of its methods. Godot 4 uses instantiate(), which returns a Node. You still add that node to the tree yourself.

Fix

func spawn(packed: PackedScene, parent: Node) -> Node:
	var node := packed.instantiate()
	parent.add_child(node)
	return node

Related

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