0 votes

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?

in Engine by (100 points)

1 Answer

+1 vote

$ 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.

by (68 points)

Thanks for explaining.

Welcome to Godot Engine Q&A, where you can ask questions and receive answers from other members of the community.

Please make sure to read Frequently asked questions and How to use this Q&A? before posting your first questions.
Social login is currently unavailable. If you've previously logged in with a Facebook or GitHub account, use the I forgot my password link in the login box to set a password for your account. If you still can't access your account, send an email to webmaster@godotengine.org with your username.