So you could do: gamevariables[gamevariables.keys()[0]] or gamevariables.values()[0].
Thank you for your answer. Although, I have to admit, after countless tries, that I am absolutely clueless as of how to do convert that in C#…
I indeed knew about the existence of the “Keys” method. But it only returns an array of keys which you might think could allow you to iterate through each entry but, for a reason I can’t understand, it doesn’t.
doing this gamevariables[gamevariables.keys()[0]] is not possible in C#
and not even gamevariables.Keys[0]
Dostoi | 2022-06-01 15:01
I dug into it: You need to create an Array from Keys or Values, since they are of type ICollection which doesn’t support indexing.
Try:
var keys = new Godot.Collections.Array(gamevariables.Keys);
GD.Print(gamevariables[keys[0]]);
omggomb | 2022-06-01 15:36
That’s it! I can’t express how grateful I am for your help. Thank you omggomb.