I’m implementing a combo attack system in Unity using the new Input System. My game has three attack inputs:
- Left Mouse Button (Attack1)
- Right Mouse Button (Attack2)
- A combination of both (Attack3)
The problem is that when I press the combo input (LMB + RMB), it also triggers both Attack1 and Attack2 individually, which breaks the intended behavior.
I’ve tried configuring composite bindings with override modifiers and changing the modifiers order under the Composite submenu, but none of that worked as expected.
Maybe this is a limitation of how the Input System handles composite inputs or something wrong in my implementation. I’d appreciate any insight or solutions from anyone who’s dealt with this kind of multi-input overlap before. Thanks in advance!
private InputAction attackAction1;
private InputAction attackAction2;
private InputAction attackAction3;
private void Start()
{
attackAction1 = InputSystem.actions.FindAction("Attack1");
attackAction2 = InputSystem.actions.FindAction("Attack2");
attackAction3 = InputSystem.actions.FindAction("Attack3");
attackAction1.performed += OnAttackInput;
attackAction2.performed += OnAttackInput;
attackAction3.performed += OnAttackInput;
attackAction1.Enable();
attackAction2.Enable();
attackAction3.Enable();
}
private void OnAttackInput(InputAction.CallbackContext ctx)
{
Debug.Log($"Attack Input Triggered: {ctx.action.name}");
}
