Is there a way to retrieve the path of a node in the scene tree?

Godot Version

4.3.dev6

Question

Is there a way to retrieve the current path of a node in the scene tree?

class_name Player
extends CharacterBody2D

func _ready() -> void:
	# get the path of this node in the scene tree
	#var tree_path := "root/World/Player"

Yes, get_path()

2 Likes

Thank you very much!

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.