How to create custom key bindings in the options menu

I am trying to create a section in my options menu so that the player can bind their own custom keys to whatever controls they like in the game. Here is my code so far and I can’t figure out why I am getting so many red underlines. 119015-dictionarything.png

Here is one of the error messages I get…

I followed this tutorial EXACTLY the same as he did, and on the video, his code doesn’t show up red like mine.

1 Answer

1

I know this is old, but for anyone else looking for an answer to this:

You are closing off the key.Add(string, keycode) method too soon; remove the closing parathesis ‘)’ after your strings.

keys.Add(“Up”, KeyCode.W); instead of key.Add(“Up”), KeyCode.W)