As you mentioned, I changed the initial mouse capture mode in the project settings.
And this is the input action configured in the Player Controller Blueprint. Both IA_Inventory and IA_CloseUI are bound to the Q key. IA_Inventory is contained in IMC_Default, and IA_CloseUI is contained in IMC_UI.
If you look at the bottom right, there is a node that resets the mouse capture mode.
The ‘FL_ControlForWidgetOrGame’ function is included in the Blueprint function library. This was created to simplify changing mouse settings or input modes in various Blueprints.
You may not be able to read it because it’s in Korean, but I clearly enabled this to enable focus on the widget.
As a result, there was some success. Originally, ‘Game and UI’ was not used. I only used ‘UI Only’ and ‘Game Only’. However, when I used ‘Game and UI’ instead of ‘UI Only’ when opening the widget, I was able to press the button with one click.
But sadly, the problem has not been completely resolved. Closing the UI no longer moves the mouse out of the viewport, but I still have to click the screen once to turn my character’s head.
You have already helped me a lot, and I am grateful for that. But if you don’t mind, could you please check to see if I missed anything?