While using first person movement and the mouse and keyboard input method, I am trying to allow for multiple input methods for the same functions.
1) CursorHorizontal/Vertical:
I have these axes types set to mouse movement, as per the default, but I would also like these functions to be performed by keyboard keys. For instance, the q and e keys should turn the player left and right. In Unity, the axis "type" seems to be a single possible choice for each axis, so I cannot add in an alternative button, as the type is only set to mouse movement. I've also tried to create another set of CursorHorizontal/Vertical axes, but these do not appear to function at all.
Any idea on how to map the cursor movement to mouse movement and also a key press?
2) InteractionA/B
It is my understanding that these axes are only available in the keyboard or controller input mode, and I tried mapping the space button to an InteractionA axis in mouse and keyboard input mode, but it didn't seem to function.
Any idea on how to get these axes to function on a mouse click in addition to a key click in mouse and keyboard input mode?
Also, minor related problem:
3) I am trying to allow the inventory menu to open when clicking the appropriate gui button, but also when pressing the i key. I set up a cutscene which loops on itself in the background with the Input: Check action, and I've tried both the button and axis check types. When I try the button check type, I get an error: "UnityException: Input Button i is not setup." I then tried to set up an "i" axis, with the i key for the positive, but the same problem arose.
I then tried the axis check type, and created an axis called "Inventory" with the i key for positive, and once again, this fails to function.
Any idea why I'm having so much trouble with the input manager?
Thanks as always for the help!
Comments
If you want multiple control schemes, however, better to have the "Input method" setting actually change mid-game. The code to change this would be:
AdvGame.GetReferences ().settingsManager.inputMethod = InputMethod.KeyboardOrController;
But I'll add this to the Engine: Manage systems Action if that would be useful. Either way, you'd want to create a new Global Variable that determines which Input mode to use (try an Integer), and set Link to to Options Data. You could then create an Options menu (e.g. a Toggle) that affects this Variable's value, and an ActionList that runs when it's closed would then set the appropriate Input method.
freeAim = Vector2.zero;
within it. There should be three. In Keyboard Or Controller mode, you'll want the second one. Just change it to read in your custom Input instead. There should be a similar line you can use for reference just above it, which is used when the cursor is locked.