I'm trying to disable the joystick controls so when I zoom in on my character(and he is aiming), he won't start to move if the player accidently hits the joystick while he is in aim mode.
I'm using the --new input system from the starter assets (action type/passthrough & control type/Vector2)-- and I'm using a locomotion blend tree (2D free form Directional as the blend type)
(The two lines below are what I want to disable)
playerControls.PlayerMovement.Movement.performed += i => movementInput = i.ReadValue<Vector2>();
playerControls.PlayerMovement.Camera.performed += i => cameraInput = i.ReadValue<Vector2>();
private void OnEnable()
{
if (playerControls == null)
{
playerControls = new PlayerControls();
playerControls.PlayerMovement.Movement.performed += i => movementInput = i.ReadValue<Vector2>();
playerControls.PlayerMovement.Camera.performed += i => cameraInput = i.ReadValue<Vector2>();
playerControls.PlayerMovement.Run.performed += i => runInput = true; /// Hold
playerControls.PlayerMovement.Run.canceled += i => runInput = false; /// Let Go
playerControls.PlayerMovement.QuickTurn.performed += i => QuickTurnInput = true;
playerControls.PlayerActions.Aim.performed += i => aimingInput= true;
playerControls.PlayerActions.Aim.canceled += i => aimingInput = false;
playerControls.PlayerActions.Shoot.performed += i => shootInput = true;
playerControls.PlayerActions.Shoot.canceled += i => shootInput = false;
}
playerControls.Enable();
}