How to start with disabled controls?

Hey,

I am using the “new” input system. When a player joins (by pressing a controller button) I want to disable their inputs for a second to prevent unwanted actions (e.g. clicking the first selected UI-button).

In other words, I want to instantiate the PlayerInput with disabled actions per default, to switch them on later.

I tried using

private void Awake()
    {
        PlayerInput.actions.Disable();
    }

but this does not work. The action map does not get disabled at all. Adding this to Start does work, but then the first Input always gets through.

have you tried to disable the actionmap instead? Or just disable the PlayerInput component altogether.

Thank you for your answer.

Isn’t PlayerInput.actions.Disable() doing exactly that, disabling the whole actionmap? Or am I doing it wrong? I mean it seems to work, just not during Awake. (Class InputActionMap | Input System | 1.0.2)

When the PlayerInput Component gets disabled I think it unbinds the connected devices, which means that they automatically rejoin as a new player when they press a button.