when i autoload a script how do i access its varibles or values

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

how do i access a script and its varibles or values when i autoload it?

:bust_in_silhouette: Reply From: rossunger

when you add an autoload you give it a name…
e.g. globals : res://myglobals.gd

then in script you just type globals.myVariable to access a variable.
or globals.myFunction() for function calls

thanks so much! by the way was the “my” an important part of the script, like do i have to write “my” before the value

umma | 2022-02-01 01:28

No! that was just an example… just use your variable name or your function name

rossunger | 2022-02-01 01:28