did they make Input System less verbose?

Zero benefit to this Enable Disable boilerplate because, I mean I'm not Enabling physics, or Graphics, so why should I bother about Input?

Usually these things slowly decay but I saw a recent post by one of the engine dev who sped up some old API without making it more cumbersome, so I figured the same good devs might be taking a stab at this thing.
9770529--1399992--upload_2024-4-14_14-12-38.png


It's to support multiple control layouts (eg on foot, driving, menus, etc). If you use the PlayerInput workflow it's handled for you.

Also 1.8 already changed this, you should take a look.

1 Like

Yes being able to Enable/Disable individual inputs is pretty crucial. You can enable/disable entire Input Action Maps for when you, for example, need to entirely disable the player's input.

It's beneficial in most projects to centralise input, and I suppose this is what 1.8 has tried to solve too.

2 Likes

Check the recommended workflow on the docs for 1.8, you'll be pleasantly surprised.

https://docs.unity3d.com/Packages/com.unity.inputsystem@1.8/manual/Workflow-Actions.html

1 Like

The Input System tries do avoid doing work unless needed. The input data is collected by the backend and only directly copied – unless actions and controls then read and process the data, no superfluous work is done.

If you have tons of action but only need some of them at any given point in your game, you don't want all actions always reading and processing input. Enabling/disabling actions/maps allows you to set for which actions you want processing to be done.

If you don't care, just enable all actions at the start and be done with it. You can do this for a whole input action asset at once and then don't need to enable actions individually.

It's equivalent to de-/activating game objects so they don't get processed for physics or rendering when you don't need them.

2 Likes


Very cool! Thanks.

using UnityEngine;
using UnityEngine.InputSystem;

public class InputManager : MonoBehaviour
{
    public InputActionAsset inputMap;

    void OnEnable()
    {
        inputMap.Enable();
    }

    void OnDisable()
    {
        inputMap.Disable();
    }
}