Attention | Topic was automatically imported from the old Question2Answer platform. | |
Asked By | Shazelz |
The line is question is this one
$Camera2D/HUD/HUDLayer/Ammo.text = str(Global.ammo) + "/" + str(Global.max_ammo)
and it has the error
Invalid set index 'text' (on base: 'null instance') with value of type 'String'.
with a secondary error of
get_node: Node not found: HUDLayer/Ammo
the even stranger part of this was it just broke randomly and I was never having a problem with it before, the code seems to be completely correct even by checking other errors like this on other questions it is usually that they spelt something wrong or missed capitalization which is not the problem
node structure
Camera2D/HUD/HUDLayer/Ammo
Is Camera2D the node the script is on? If so, it shouldn’t be in the node path.
exuin | 2021-02-18 16:07
Oh no sorry the root node is what the script is on if forgot to add the camera node to the text as I was making changes and then undid them
Shazelz | 2021-02-18 16:32