The "Static Instance Pattern" seems like a bit of a hack... But is it actually a legitimate and useful way to use #Godot?

https://blog.hortopan.com/you-dont-need-globals-in-godot-use-static-var

Interested to hear thoughts.

#GodotEngine #Godot4 #GDScript #GameDev

You Don’t Need Globals in Godot: Use static var

What's one way to handle Global Objects in Godot?

Alex Hortopan's blog

@ConditionalCoder in your specific example, if you ever add a second node of this type, it will override the static instance. You probably want a null check to ensure an actual singleton.

But in any case, Godot’s autoloads seem to solve the same problem in a better way.