-
-
Notifications
You must be signed in to change notification settings - Fork 21k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
get_node() does not accept StringName variables as a valid argument #71319
Comments
Try |
Like I said, I just typed the array to String |
To give a practical example, I encountered this issue like this (v4.0.stable.official [92bee43]): var graph_edit:GraphEdit = $"../Panel/VBoxContainer/GraphEdit"
for connection in graph_edit.get_connection_list():
var graph_node = graph_edit.get_node(connection.from) # <<< ERROR The solution is to modify |
I've just hit this bug with an @rpc call over a dict where some of the values were randomly arriving as StringNames, in particular the one which held the nodename value. This weird type is only made visible when you print the whole dict and there's this unexpected '&' after the ':'. |
Godot version
4.0 Beta 11
System information
Win 10, Forward+, 1080ti, 516.94 driver
Issue description
Simply put if you try to get a node by using a StringName as an argument you'll get the error
Parser Error: Invalid argument for "get_node()" function: argument 1 should be "NodePath" but is "StringName".
which is likely an oversight because doing
get_name()
on a node gives a StringName.I came across this when I was trying to loop through some nodes, checking names of nodes in an array vs the children of a node, but was able to easily work around it by making the array a string typed array
Steps to reproduce
I uploaded an mrp, but the code is as simple as
Minimal reproduction project
bug.zip
The text was updated successfully, but these errors were encountered: