How can i change a variable in another scene?

:information_source: Attention Topic was automatically imported from the old Question2Answer platform.
:bust_in_silhouette: Asked By ElanX

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/”.
The players script is in: “res://Player/”.
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

:bust_in_silhouette: Reply From: kidscancode

“res://Skills/Fireball/” 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:

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

ElanX | 2019-08-01 08:55