How acess variables from other script

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

How acess variables from other script

:bust_in_silhouette: Reply From: PepijnWe

It depends on how the connection is made, but one example would be:

onready var accesNode = get_node("/root/.. ..../NodeTheScriptIsIn")
var Myvar = accesNode.var

Where you load the node using the get_node method. To which the script is attached.
And then you can use the accesNode.(youdefinedvar) to acces it.

Or i can use export and in other script i use $node.var but this is only for read

RodizzGamer | 2020-05-23 18:39