- Home /
How to use inputmanger while scripting?
How would I call a input I added to the input manager? I need to transfer the E key to become a on screen button for mobile devices.
Answer by rd_mcn · Mar 17, 2018 at 02:54 AM
The InputManager allows a named string to be associated with an action. When you create an entry in the InputManager and name it, then you use that name when you call
Input.GetAxis( "MyAxis" );
Input.GetButton( "MyButton" );
Hope this helps.
Whether you call Axis or Button depends on the Type you have assigned in the Input$$anonymous$$anager.
The name of the Button is currently just E so I would type in Input.GetButton("E"); to call that input?
Not really as this bypasses the Input$$anonymous$$anager. If you call
Input.GetButton( "E" );
it simply looks for the E button on a keyboard. If you use the Input$$anonymous$$anager and assign a name to it, then you can change or utilise multiple input sources for that one name. Have attached a screenshot from a game I'm working on.
I seem unable to upload an image or file, no idea why :-(