Godot Version
v4.2.1.stable.mono.official [b09f793f5]
Question
I created a “Stat” class in wich I define stuff like baseValue, stat modifiers etc.
Now I want to use it inside of a dictionary, so I did:
[Export]Godot.Collections.Dictionary stats = new Godot.Collections.Dictionary
{
{"CurrentHealth", new Stat(100)}, //100 is the baseValue
//ETC.
}
But now I have a problem when accessing the class’ variables.
I want to do this:
stats["CurrentHealth"].baseValue -= damage;
However I get the following error:
'Variant' does not contain a definition for 'baseValue' and no accessible extension method 'baseValue' accepting a first argument of type 'Variant' could be found (are you missing a using directive or an assembly reference?)
What am I doing wrong?