What is $'.'

:information_source: Attention Topic was automatically imported from the old Question2Answer platform.
:bust_in_silhouette: Asked By ashish

What is $‘.’?
If I have a code like:

Blockquote

onready var test = $‘.’

function _ready():
print(test)

I get an output in the debugger as
[Node2D: 1207]

What does this mean?

:bust_in_silhouette: Reply From: Coweh

$ is a shortcut for get_node(). get_node() will get the node at the provided path. get_node('.') or $'.' would get the current node, because . represents the current node. You can read the docs for it here.

Thanks for explaining.

ashish | 2020-10-05 10:54