Hide/show mouse cursor alongside changing mapping contexts locks mouse look

Hi, so I’m changing the mapping context when interacting with certain actor in my game, like so:

Then when I’m done interacting, I’m changing the context back, in the player character blueprint:

Problem is, the mouse look gets locked within a certain radius after that, I cannot turn 360 like usual anymore. Like the mouse cursor would still be there and stopping me from turning when it reaches the edge of the window?
It’s hard to explain, you’d have to copy the code to understand better.

Here’s the mapping context:


I’m just using the right mouse button in this case. The other mapping context is just the default that comes with first person template.
Any help? Thanks.

I assume that you didn’t change the input focus back to the game, if you call Set Input Mode Game Only it would work.

1 Like

I tried that, like this:


… but for some reason, the enhanced input action doesn’t trigger on first click anymore. I have to click a few times for it to trigger.

Edit:
Adding “Set Input Mode Game And UI” to the actor blueprint as well, made it work properly:

But I don’t need it for gameplay purposes. I hope it won’t conflict with something else in the future, because this actor has a widget component as well as a widget interaction component.
Thanks for the help.

I am glad helped you, you can mark it as solved

1 Like