How to use Input with on screen buttons.
Disabling Movement for UI
To switch to UI, you can change the Action Map. You need to set the default action map in the previous section first before switching.
using UnityEngine.InputSystem;
...
[SerializeField] private PlayerInput playerInput;
public void OnOpenMenu(InputAction.CallbackContext ctx)
{
Debug.Log("UI Should Open");
playerInput.SwitchCurrentActionMap("UI");
}
Alternately, You can switch the Action Map in the Inspector of the PlayerInputComponent.