- Home /
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.
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. https://www.youtube.com/watch?v=MEHe0Uf3m4I
Answer by Slendermain · Mar 05, 2019 at 08:09 PM
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)
Your answer
![](https://koobas.hobune.stream/wayback/20220612164853im_/https://answers.unity.com/themes/thub/images/avi.jpg)
Follow this Question
Related Questions
Multiple Cars not working 1 Answer
Distribute terrain in zones 3 Answers
Array member treated as null even though it is not. 1 Answer