The script i made doesn't record what the person presses after pressing the ` key. Thats all I really know. but you guys can look at it to see if theres any other things i could do..
asked Mar 13 '11 at 05:53 PM
I don't know how but this script doesn't show any compiler errors. It still doesn't seem to do anything though. Like Myth says is there any specific need to remap the keys at runtime? If you just want to change the keys you can go into "edit ~> project settings ~> input" and specify the keys and their names (which is the method used for calling them) In there you can set an axis' positive and negative buttons (or just a buttons positive if its only an on/off button) you can also set alternative buttons (so effectively setting two sets of keys for the same input) if for instance with movement you prefere to use WASD and a friend preferes the directional keys it is handy to set alternative keys.
If however you want to press a button during the game and completely change a control set may I suggest still changing the inputs via project settings but setting two completely different sets of keys, then creating a script which on a certain key press, disables one set of controls and enables the other. Which can be done all in the same script with a simple if variable, for instance
CTS stands for Control Set Two but this is just an example you would have define the exact naming convention in the input settings then adapt your script to suit.
answered Mar 14 '11 at 03:04 AM