Hey, I'm trying to access sub-values in my dictionnaries using the name of the node trying to access those said values.
I'm storing a name on a Singleton when pressing a button like so :
func _on_Confirm_pressed():
GameData.characters["Player"]["Character_name"] = Character_name
Dictionnary looks like that :
var characters = {
"Player": {
"Character_name": "",
"Username": "",
}
}
And when the node is intanced, I try to access it like so :
func _ready():
print(GameData.characters[str(self.name)]["Character_name"])
I tried both with and without the str(), but I can't seem to make this work.
How can I access my dictionnary using the name of the node calling it ?