How To Release Mouse Lock On Game Window?

When playing a game either in the editor or stand-alone, the game doesn’t allow the mouse to go outside of the game window. I need to be able to move in and out freely even if the game has focus. Does anyone know how to accomplish this?

By default mouse doesn’t lock to viewport neither in editor nor in game.
How did you lock mouse? Try to find “Set Input Mode Game and UI” or “LockMouseToViewport”.

In editor Shift+F1 to unlock mouse.

Mouse was locked on game window by default in my case (UE5.4 project).
This was solved by making a change in Project Settings

Project settings > Engine > Input > Default Viewport Mouse Lock Mode > “Do not Lock”

1 Like

Same issue as well. Found a way to turn that off in the editor settings:

Bet there’s a way to do it in code as well but I haven’t looked yet