Hello,
I’m encountering an issue with the Unity Input System and its handling of input actions. I have set up two action maps: “CharacterMovement” and “CharacterJump.”
In the “CharacterMovement” action map, I have configured the “Run” action to activate when I press the left shift button. In the “CharacterJump” action map, I have configured the “Jump” action to activate when I press the Space button.
The problem I’m facing is that when I have the “Run” button held down and try to press the “Jump” button, the “Jump” action’s function is not being triggered. Conversely, if I hold the “Jump” button, the “Run” action doesn’t work.
System Information:
- Unity version: 2021.3.8f1
- Input System version: 1.4.4
Below, I will provide the section of the code where I handle these actions and include images to demonstrate how they are configured in the Input Actions System.
private void Run(InputAction.CallbackContext context)
{
Debug.Log("RUNNING");
isRunning = true;
}
private void Jump(InputAction.CallbackContext context)
{
Debug.Log("NOT BEING CALLED WHEN PLAYER IS RUNNING");
if (!isJumping)
{
animator.SetTrigger(isJumpingHash);
}
}
private void enablePlayerInputs()
{
playerInput.Enable();
playerInput.CharacterMovement.KeyboardWalk.performed += KeyboardMove;
playerInput.CharacterMovement.KeyboardWalk.canceled += StopKeyboardMove;
playerInput.CharacterMovement.MouseWalk.performed += MouseMove;
playerInput.CharacterMovement.MouseWalk.canceled += StopMouseMove;
playerInput.CharacterMovement.Run.started += Run;
playerInput.CharacterMovement.Run.canceled += StopRun;
playerInput.CharacterJump.Jump.started += Jump;
playerInput.CharacterJump.Jump.canceled += StopJump;
}
Thank you in advance for your help.