Rapid Prototyping With Unity’s New Input System
Objective: To look at the New Input System’s options for Rapid Prototyping.
Using the Old Input System we are used to being able to quickly prototype some controls for a project simply using the Input.GetKeyDown, Input.GetKeyUp and Input.GetKey commands.
However, we don’t have that luxury with the New Input System as we have to setup an Input Action Asset, Action Maps, Actions, Bindings — Interactions/Processors (if needed) and then go and build the code.
Or, do we have that luxury?
Rapid Prototyping in the New Input System
Within the UnityEngine.InputSystem namespace we have classes that are dedicated to specific types of inputs. Here in the above image you can see that we have Keyboard, Mouse and Gamepad as some examples.
Within these classes we can check when a key/button is being pressed and add logic (e.g. such as jumping) without having to go and set up Actions/Bindings all the time, making rapid prototyping for projects more efficient. Here we are using the ‘wasPressedThisFrame’ property.
We also have access (but not limited to) another property called — ‘isPressed’. Both of these options returning ‘true’ (bool) when the key/button is pressed. However, ‘isPressed’ will run multiple times per frame as seen in the Console Window:
Next Article
“Creating a Progress Bar With Unity’s New Input System”