I've been following a Youtube tutorial to make a fighting game and I ran into this issue with my Dictionary variables and I don't know what to do (I'm new to coding and I've never heard of this dictionary stuff) The issue is Invalid get index 'General' (on base: Dictionary)



That error happens when you're trying to do something like this:

var g = 'General'
var h = d[g]

It means that you're using the string, "General" as the key of a dictionary, but the dictionary doesn't have that key. That might happen if you had a variable called General and quoted it when it shouldn't have been. Or you might have meant to put "General" in your nameDictionary, but didn't put it in.

I don't see where that error would be in the code, perhaps you took a picture of the wrong file or not all the code. In any case, you should post text code on the forum. Posting screenshots are hard to read and cannot be searched by search engines. If you want to post code, select all the code and copy from Godot, then on the forum you can type 3 tildes "~~~" on a line by themselves directly above and directly below the pasted code. It would also helpful to copy and paste the full error message, including the file name and line number of the error (you can also double click the error and it should take you to the line where it happened). Hope that helps.

5 months later