You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When checking my scripts, I get a lot of these errors:
my_script.gd:
player.reparent($/root/Level)
^
Unexpected token Token('SLASH', '/') at line 13, column 19.
Expected one of:
* NAME
* LONG_STRING
* PERCENT
* REGULAR_STRING
Previous tokens: [Token('DOLLAR', '$')]
I normally use this method similar to the one shown on the second line when I need to grab a node and want to find it from the root of the SceneTree, as detailed here except by using the $ shorthand instead of the get_node() method.
I was able to avoid triggering the error by putting the path in quotes after the dollar sign. i.e.: player.reparent($"/root/Level") I've never had any problems in game with not using quote marks in these kinds of paths although I have no idea if it's best practice. Either way the big error message seems unintentional but I apologise if I'm wrong.
The text was updated successfully, but these errors were encountered:
When checking my scripts, I get a lot of these errors:
I normally use this method similar to the one shown on the second line when I need to grab a node and want to find it from the root of the SceneTree, as detailed here except by using the
$
shorthand instead of theget_node()
method.I was able to avoid triggering the error by putting the path in quotes after the dollar sign. i.e.:
player.reparent($"/root/Level")
I've never had any problems in game with not using quote marks in these kinds of paths although I have no idea if it's best practice. Either way the big error message seems unintentional but I apologise if I'm wrong.The text was updated successfully, but these errors were encountered: