Hey folks !
I'm new to Godot (and scripting overall actually ><). I'm following a tutorial to make a cardgame (( but already have some issues (3 years old tuto, so I suppose how the script was written doesn't work anymore ?)
Here's the script :
extends MarginContainer
@onready var CardDatabase = preload("res://Assets/Cards/CardsDatabase.gd")
var Cardname = "Footman":
@onready var CardInfo = CardDatabase.DATA[CardDatabase.get(Cardname)] <- ERROR HERE
func _ready():
print(CardInfo)
The error is : "Cannot call non-static function "get()" on the class "res://Assets/Cards/CardsDatabase.gd" directly. Make an instance instead."
So, my question is : How do I make this instance ?