Hi I'm new to Godot and am trying to create my first game, but not sure how to load the global resources properly?

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

I don’t really know the proper way to do this, and I’m not sure if I need to use a get_node or something. This is the code at the beginning of my scene:

extends Node2D

onready var global = Global

This doesn’t work as it says

The identifier “Global” isn’t declared in the current scope.

But I have no idea of an alternative. Any help would be much appreciated, thanks!

:bust_in_silhouette: Reply From: deaton64

Hi,
You need to autoload your script as a Singleton.

See here