TLDR: The “Set Mouse Position” node doesn’t seem to do anything when toggling UI/Game
When trying to set the input mode (between game only and game/UI), then setting the show mouse cursor boolean, the Set Mouse Position" node doesn’t seem to work at all. I have tried to rearrange the nodes around many times, but nothing has worked out.
Recreating it is easy in a new first-person-shooter template that comes with the unreal editor, as you just need to add the nodes to a new/existing BP copied from a pastebin or the screenshot below:
The only fix I found was waiting two ticks to update the mouse cursor position after showing the cursor, pictured below (Note the two added “Delay Until Next Tick” nodes):
But this causes a visible problem where now the cursor “jumps” from it’s old position to the middle of the screen
Am I doing something wrong? Is there a setting I do not know about? This is the biggest bug I’ve faced since moving from unity.
Thanks
When it comes to the original issue: is the goal of entering Game and UI mode to pop up a widget and have the cursor manifest in the screen centre, ready to be used with widgets? In which case I’d try:
After giving the widget in question focus (on the Set Input Mode Game and UI node). However, unsure how the rest of the setup looks like, and what’s the scenario / end goal is. So this might be a miss.
The thing with UMG is that widgets and the player controller often “fight” over cursor behaviour (sort of). In your example, you get ready to enter a mode where UI gets priority but then immediately ask the controller who has just lost control over the cursor to position it.