Inputs
Managing player inputs can quickly become overwhelming. Essential Systems streamlines the process with Inputs, making changes and customization effortless.
Last updated
Managing player inputs can quickly become overwhelming. Essential Systems streamlines the process with Inputs, making changes and customization effortless.
Last updated
To handle all inputs we use the Input Manager
script. You can add this to any game object in the scene hierarchy (it will become DontDestroyOnLoad
scene gets loaded.
There must always be exactly one Input Manager
at any time.
To actually assign inputs and keybindings we create and use Input
objects. You can create your own by right-clicking anywhere in the project and go to Create/Essentials/Inputs/<your desired input system>/Input
. This will create a new Input
object where you can define which keys/reference to Input Action Asset. One Input
can contain multiple keys that all maps to the same action.
The Input
object also comes with a Scheme
property. This is where you can define where the input can be used.
Here, we do not provide a Scheme
property. Instead, you must add all EScheme
entries to the Action Map
in the Player Input
with the exact same name and casing.
An EScheme
is a way for you to tell the Input Manager
what scope it should listen to inputs in. For example; if you have a pause menu and you pause the game, you may only want to listen to UI inputs and ignore all player inputs. This can be done using Scheme
.
To set the current Scheme
in runtime, you can simply call:
By default, only two pre-made schemes are available, UI
and DEFAULT
. You can add your own by opening the Input Manager
script. At the top of the script, you will find an enum; EScheme
. Here you can simply add your entry (if you are using the New Input System
you must also add it to the Action Map
).