Game Toolkit for Unity
Learn more about Makinom’s input system.
Input keys build a control layer between Makinom and various input sources (e.g. Unity’s input manager or 3rd party solutions). This allows inputs to be set via Control HUDs (for virtual on screen controls, e.g. on mobile platforms), schematics (Set Input Key node) or via scripting.
You can create new input keys in Base/Control > Input Keys.
The input origin defines where an input key’s input is coming from. There are several input origins available out of the box and you can use the Custom input origin to quickly connect 3rd party input systems via reflection.
You can also create custom input origins by deriving your class from the BaseInputIDKeySetting. Check out the included input origins for examples.
Input Origin: Select where the input of the key will come from:
Uses a selected axis of the last linear acceleration of a device.
This is usually only available on mobile devices that have an acceleration sensor.
Uses reflection to call static functions of a class.
You can add parameters to the function calls, e.g. a string parameter to pass on an identifier/name for the input you want to use.
The function for button input has to return a bool value.
The function for getting the input’s axis value has to return a float value.
Uses a selected axis of gyroscope data of a device.
This is usually only available on mobile devices that have an gyroscope sensor.
Uses other input keys as input.
This can be used to bundle multiple sources into a single input key, e.g. when having multiple horizontal and vertical inputs (from keyboard, controllers, etc.).
Another use is key combinations, e.g. allowing Alt + 1 as an input.
Uses the key mapped to a selected key code.
This is a quick and easy way to set up inputs without any additional setup in the Unity input manager or other input sources.
Uses an input key combo sequence.
This allows getting an input after a defined sequence of input keys was used, e.g. A > A or Up > Down > Up > Down.
The individual parts of the sequence can define a timeout until the sequence is reset and input keys to ignore (i.e. not break the sequence).
Uses a mouse button and mouse position change as axis.
This doesn’t use a direct input.
Use this input origin for input keys that should only receive input from HUDs, schematics or via code.
Uses a touch input and touch position change as axis.
This is usually only available on devices with touch screens (e.g. mobile phones or tablets).
Uses a key defined in the Unity input manager.
E.g. the scroll wheel of a mouse is usually set up via the input manager.
Input IDs allow having multiple input origins for an input key. They’re used to create different control styles/layouts or allow local multiplayer controls.
The default (global) input ID is 0 when starting a game. Machines can either use the default input ID or override it, i.e. this can be used to have machines with the same schematic react to different input.
The global input ID can also be changed in-game, e.g. for switching control styles.
The minimum input ID is 0, an input ID of -1 can be used to check for any inputs of an input key (ignoring input ID).
The Accept and Cancel input keys have 2 input origins each.
Accept uses joystick button 1 for input ID 0 and joystick button 2 for input ID 1.
Cancel uses joystick button 2 for input ID 0 and joystick button 1 for input ID 1.
Switching the global input ID between 0 and 1 allows switching the Accept and Cancel input key’s buttons.
© 2015 Gaming is Love e.U.
Disclosure: This site may contain affiliate links, which means I may receive a commission if you click a link and purchase something that I have recommended. While clicking these links won’t cost you any money, they will help me fund my development projects while recommending great assets!