![]() |
Attention | Topic was automatically imported from the old Question2Answer platform. |
![]() |
Asked By | Kajice |
For context:
I am following a tutorial for GodotSteam: https://www.youtube.com/watch?v=si50G3S1XGU&t=722s
I’m at min 15:30 right now where we’re trying to run the project without having Steam running on purpose. The expected result was to get a “failed to initialize Steam” message.
The error:
Instead, I get an error from Godot:
Invalid get index 'STEAM_NAME (on base: 'GDScript')
I made a script steam_name.gd with the class_name SteamMain. The script has a member variable declared as such:
extends Node
class_name SteamMain
var STEAM_NAME := "Name"
I initialized it with the value “Name” for testing purposes. I autoload steam_main.gd. I am sure this script actually loads, I made it print “test” in the ready function and I see that in the Output before the error occurs.
The error occurs here in my script lobby.gd which is attached to my Lobby scene, the current main scene of the project:
func _ready() -> void:
steam_name_label.text = SteamMain.STEAM_NAME
steam_name_label is just a label node in the scene:
onready var steam_name_label = $SteamNameLabel
Does anyone know why this error occurs? I’m on version v3.1.2.
(Sorry for the excessive detail in this question, better safe than sorry)