In my game there is a GUI textfield where you can fill in your name.
What I would like to have is that you only can use the 26 characters from the alphabet (a … z and A … Z) and space.
I know that it’s not possible to disable keys from the keyboard but how can I achieve that nothing happens when another key is hit?
The best thing is to intercept incoming characters and change them to null if they are undesired; see my answer here. (Unityscript uses the index of a string to indicate chars, so for example change ‘a’ in C# to “a”[0] in Unityscript).
@YanrikLabCegep This is a 12 year old thread. Do not necro-post. Also your solution is wrong not only because the general approach is really old, but also because you’re just modifying a regular expression without properly understanding what it does. Please start a new thread if you need more help, but this topic alone isn’t really useful anymore (and mods will probably lock it now).