Godot Version
4.5
Question
I’m trying to make a simple platformer and am currently working on the checkpoint flags. Here is my problem. The checkpoint flags need access to the PlayerSpawnPoint node so that it can move the player spawn point around. However, the flags are scene tiles in the Level TileMapLayer node, and I can’t get them to access the nodes in the tree.
Does anybody know how I could do this?
Code + Scene Tree
extends Area2D #checkpoint_flag.gd
@onready var player_spawn_point: Marker2D = $%Level.get_node("$%PlayerSpawnPoint")
func _on_body_entered(body: Node2D) -> void:
if body.name == "Player":
player_spawn_point.position = position
The checkpoint flag is a scene tile in Level

