+1 vote

I Have no idea what im doing wrong here.

My tree is like so:
Its in its own scene
HUD > Score

Score is a child of HUD.

The HUD script is =

extends CanvasLayer

func updatescore():
    $Score.text = str(global.score)

It says it cant find the node. Even though when i do get_node it shows Score as an option in a drop down?

Any help much appreciated

in Engine by (51 points)

1 Answer

+1 vote
Best answer

try using the absolute path first. If that doesn't work, then you have a scene problem. See my reply https://godotengine.org/qa/33341/updating-the-score-label-after-player-hits-a-collectable?show=33390#c33390

Also try self.get_node("Score")

by (808 points)
selected by

I finaly understand what your trying to say. Thank you very much. I Thought i understood it But now i fully understand what your saying. Thank you very much.

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 [email protected] with your username.