How do I lock the mouse to the viewport?

I am using the Set Input Mode Game and UI blueprint to display my UI and give it input and I would also like to use it to lock my mouse inside the viewport. The node has an option to lock the mouse to the viewport, but it does not seem to work… Is something that is not implemented yet, and if so are there any work arounds?

Does anyone have any info on ?

Can you check in your Editor Settings -> under the “Level Editor” section click on “Play” then in the settings that get displayed, see if “Game Gets Mouse Control” is enabled, if it is not turn it on and try playing the game again. should keep the mouse within bounds with the Lock Mouse to Viewport turned on.

Thanks for the response! It seems to half work… When the game is launched, the mouse stays in the viewport, but once I click anywhere, the mouse then is able to move outside of the viewport. Not quite sure what could be causing that, any ideas?

same problem!!
now it’s UE4.12…how to fix it?

Same here, no fix found yet.

I’m currently having troubles with the same thing. Clicking the mouse exits locked mouse.

I’m having problem too. Anyone found a fix?

For future visitors, I had problem and “fixed” it by calling the set input game and UI function from the tick event.