Global Var Issues

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

I create a var on a script called called boost
var boost = 1

i put on autoload

on other script i put this “onready var boost = get_node(”/root/Main")

when i put “print(boost)”
says Main: [Node2D:1230]

:bust_in_silhouette: Reply From: SteveSmith

Since you’ve called the reference to Main “boost” as well as the var boost inside Main, you probably want “print(boost.boost)”.