Pulse Works Studio

Parse Error: Identifier "Position2D" not declared in the current scope. Did you mean to use "Marker2D"?

Position2D is Marker2D in Godot 4. Spawn points and aim markers use the new name.

Cause

Position2D was a Node2D that only stored a transform. Godot 4 renamed it to Marker2D so the name matches Marker3D. Scenes saved in Godot 3 still say Position2D until they are converted.

Fix

extends Node2D

@export var spawn: Marker2D

func spawn_actor(actor: PackedScene) -> Node:
	var node := actor.instantiate()
	node.global_position = spawn.global_position
	add_child(node)
	return node

Related

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