0 votes

Hello, I want to change a value in a script called "fireball".
How can i change this value from my player script? I tried it with get_node(), but every time I got the error: "Node not found: res://Skills/Fireball/Fireball.gd".
The players script is in: "res://Player/Player.gd".
Im using Godot v3.1.1 and newbie in game-engines.

I would be happy if someone could help me.

ps. sorry, for my bad english

in Engine by (12 points)

1 Answer

+2 votes

"res://Skills/Fireball/Fireball.gd" is a script file, not a node. get_node() finds a node in the scene tree.

All your nodes exist in the scene tree, but you need to know their relative locations. get_node("Fireball") for example, finds a node called "Fireball" that's a child of the current node.

I highly recommend reading the step-by-step section of the docs, starting here:
https://docs.godotengine.org/en/latest/getting_started/step_by_step/scenes_and_nodes.html

by (20,901 points)

Thank you very much. Now i know what i did wrong.
You helped me a lot. :)

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