diff --git a/Packages/com.unity.inputsystem/InputSystem/Plugins/UI/InputSystemUIInputModule.cs b/Packages/com.unity.inputsystem/InputSystem/Plugins/UI/InputSystemUIInputModule.cs index adba24a25e..dbdbb13314 100644 --- a/Packages/com.unity.inputsystem/InputSystem/Plugins/UI/InputSystemUIInputModule.cs +++ b/Packages/com.unity.inputsystem/InputSystem/Plugins/UI/InputSystemUIInputModule.cs @@ -1347,7 +1347,15 @@ public InputActionReference rightClick public InputActionReference move { get => m_MoveAction; - set => SwapAction(ref m_MoveAction, value, m_ActionsHooked, m_OnMoveDelegate); + set + { + SwapAction(ref m_MoveAction, value, m_ActionsHooked, m_OnMoveDelegate); + // Because moveAction is the only action cached in the navigation state, + // we need to read new action's current value to avoid stale state from the previous action. + m_NavigationState.move = m_MoveAction?.action != null && m_MoveAction.action.enabled + ? m_MoveAction.action.ReadValue() + : Vector2.zero; + } } ///