Introduction
The Infinite Runner Engine comes with its own input solution. It’s extremely simple by design, as most infinite runner games only require one or two button. By default it supports mobile touch, keyboard and gamepad, but you can of course build on top of that to support more exotic input systems.
Key Binding
By default, the engine includes only bindings for the four directions, and for a “MainAction”. On desktop/consoles, directions are bound to arrows on keyboard and directions on gamepad, and the MainAction is triggered by the space key on keyboard, and the A button on an XBox gamepad. You can change these key bindings using Unity’s built-in InputManager (accessed via Edit > Project Settings > Input).
Mobile Controls
On mobile, and depending on the selected control scheme for the current level, button groups will be activated in the UICamera’s canvas. For SingleButton control mode, a large clickable/touchable zone will be displayed all over the screen, while in Left/Right mode, the screen will be split in the middle into two separate zones.
Selecting a control scheme
Switching between Single Button or Left/Right mode is very easy. Just select the LevelManager in your scene’s hierarchy, and choose your desired mode using the Control Scheme dropdown.
Input Manager
For all this to work, you’ll need an InputManager in your scene (and the UICamera prefab if you’re going to support mobile controls). If there isn’t an InputManager in your scene yet, just add an empty game object and add an InputManager component to it, and you’re done!
If that’s not enough
If that’s not enough, rejoice, the asset also contains a barebones version of Nice Touch. Nice Touch is an asset initially built for the Corgi Engine. You’ll find more information about how to use it over there.