Hey there I need to use an Action called Turbo for 2 purpose, “TurboSpeed” (to move fast) and “Attack”… Like retro games. How Can I do it? . I consider Input system is more difficult than I espect even for Android’s clone retro games.
I attach a screenshot.
Do I need the same Action ? right ? or make another action using same “Key/button”.
My goal is use only 3 Gameplay’s button for Android and PC … (Buttons : For Turbo , For Jump ) (Move : Gamepad and Keyboard 1D-Horizontal)
I hate to use IA, but Groks says :
Recommendation for Turbo Interactions
In order for "Z" to function as:
Fast tap (less than 0.2 seconds) to attack (IsAttackTriggered), and
Long hold (more than 0.2 seconds) to enter PlayerMoveTurboState (IsTurboPressed),
you need to set both Interactions: Press and Hold. Here is the exact setting you should use:
1. Press Interaction
Press Point: 0.1 seconds (or 0.05 seconds if fast taps are not detected well).
This ensures that a fast tap (pressing and releasing "Z" within 0.1 seconds) is detected as an attack.
Trigger Behavior: PressAndRelease
PressAndRelease will cause Turbo.performed to trigger on both key press and release, which is great for detecting taps. This ensures that your code in PlayerInputHandler.TurboPerformed() can measure the holdTime and trigger IsAttackTriggered for fast taps.
Why not PressOnly? PressOnly only triggers Turbo.performed on press, but not on release, which could cause fast taps to not be detected correctly if the Press Point is not reached or if there is a delay in the Input System. PressAndRelease is more robust for this case.
2. Hold Interaction
Hold Time: 0.2 seconds (as is in your code, TAP_THRESHOLD = 0.2f).
This ensures that holding "Z" for more than 0.2 seconds triggers Turbo.performed as a hold for turbo mode.
Trigger Behavior: PerformedAndStayPerformed (default for Hold).
This causes Turbo.performed to trigger when it reaches 0.2 seconds and stays active while holding "Z", which is correct to keep IsTurboPressed true during turbo mode. When you release "Z", Turbo.canceled will fire, resetting IsTurboPressed to false.
3. Don't use Press alone or Hold alone
Press alone: It wouldn't detect long holds (turbo mode), as Press is only designed for fast taps. You would lose the functionality of PlayerMoveTurboState.
Hold alone: It wouldn't detect fast taps (attacks), as Hold requires holding the key for at least 0.2 seconds to trigger Turbo.performed. You would lose the functionality of attacking.
Therefore, you need both (Press and Hold) to cover both cases (taps and holds).

