Quick answer: On pause, gameplayMap.Disable() and uiMap.Enable(). Reset held action state via action.Reset() if you need to clear modifier sticky state.
Player presses Pause while holding W. Game pauses but the player keeps moving on resume because the action’s held state was never cleared.
The Symptom
After resuming from pause, character continues to move briefly. Or actions fire on the first frame of resume even though no input is held now.
The Fix
public class PauseManager : MonoBehaviour
{
public InputActionAsset asset;
private InputActionMap _gameplay;
private InputActionMap _ui;
void Awake()
{
_gameplay = asset.FindActionMap("Gameplay");
_ui = asset.FindActionMap("UI");
}
public void Pause()
{
Time.timeScale = 0;
_gameplay.Disable();
foreach (var a in _gameplay.actions) a.Reset();
_ui.Enable();
}
public void Resume()
{
Time.timeScale = 1;
_ui.Disable();
_gameplay.Enable();
}
}
Reset clears any held value. On Resume, gameplay actions start at zero; player must release and re-press to act.
UI Map for Menu Navigation
The UI ActionMap mirrors the standard EventSystem inputs (Navigate, Submit, Cancel). Switching maps on pause keeps menu navigation working without leaking gameplay events.
Verifying
Hold W. Pause mid-frame. Resume. Player should not move until you release and press again. If they slide forward, the Reset is missing.
“Disable + Reset on pause. Enable UI. Resume cleanly.”
Related Issues
For Input Action double-fire, see double-fire. For rebind handler leak, see rebind leak.
Disable. Reset. Switch maps. Pause works.