MouseX Event does not update it's value when game paused

I am using ver 4.3 and using Blueprints and I want to read MouseX value in my PlayerController when game is paused (in ESC menu). event is set to tick during pause and in fact it does tick but value does not update, it stays on 0.0. But as soon as I push one of mouse buttons value starts to update. After that it works as expected, while game is still paused.

So, I’d like to know if there is a way to have that value update constantly without having to push a button first while paused?.

I’m not exactly sure what you do with it but maybe setting two variables “bShowMouseCursor” and “bEnableClickEvents” will help you.

They will release your cursor from game (enabling to leave screen) and enable click events which allow you to create a pause menu and make it clickable while game is paused.

Check out HUD level in Content examples from marketplace to see how exactly this is used and how it works. It is in BP_HUD_Example blueprint.

Thanks for reply.

problem I have is not with click events or any of that. All that works just fine. reason I want actual Value from MouseX Event, is to detect mouse movement. I have a menu that can be used with Mouse or Keyboard or Gamepad. When I use Keyboard, or Gamepad, I want to disable Mouse Cursor and then when I start using Mouse, I want to enable Mouse Cursor.

So, in ver4.2.1 my setup for that worked great. As soon as I detect any value greater than “0” on MouseX Event, I enable Mouse Cursor. And then with Keyboard controls, as soon as I get any input from directional pad, I disable Mouse Cursor.

So, now in ver4.3 none of that works as before. mouse seems to not always update value on MouseX Event. whole system kind of relies on that one thing.

Also, with that said, disabling Mouse Cursor with Keyboard input, also doesn’t work as before. It’s like, it doesn’t register setting unless I set it using mouse. So I click my menu button using mouse, it will work every time, but if I run menu button event with keyboard, which is same set of events, Mouse Cursor stays on screen, even during game play, until I touch mouse, then it disappears. So, it’s like mouse is not updating unless you move mouse, which kinda makes sense, but I need it to always update until I disable it, if that makes any sense.

I just want to say again that all this worked in ver4.2.1 without any problems. So something with how mouse updates is changed in ver4.3 and I just wanted to know how to get around that, if it’s even possible. I’ve tried everything I can think of and I can’t get reaction that I want, like I had it in ver4.2.1.

Really late, but have you tried turning Execute when Paused boolean from event?

Yes, tried that.

mouse cursor has some general problems with how it updates. It only updates if you move it or sometimes only if you press a button.

problem with this is if you want to control cursor display with keyboard or game pad, based on what input you’re using, it’s not really possible. You have to use mouse to influence mouse. Which kinda makes sense, but also isn’t very useful.

This is really long ago so I don’t remember all details and engine versions, but in older versions it actually worked just fine, but in newer versions it does not. So something on mouse side changed some time and now it isn’t possible anymore to control how cursor is displayed unless you actually use mouse input.

If I want to switch off cursor, using keyboard, it doesn’t update that unless receiving mouse input. That’s not useful since I don’t want to use mouse while using keyboard. It doesn’t matter if game is paused or not paused. That isn’t a factor actually.

Hey Obihb,

Have you tried detecting a change in X and Y on Tick using Get Mouse Position node? I’m not entirely clear on what you’re looking to do, but it sounds like you want cursor to become hidden when there has been keyboard input, and unhidden when mouse is moved. If so, this method should work without requiring any click input from mouse.

If that doesn’t work for you, please explain in further detail what you’re looking for and we’ll see how we can get it working.

Hope this helps!

I’ll be honest, I don’t remember ever trying this through a Tick Event. I don’t think that I have, so I’ll give that a shot.

Currently I’m using a button press event and a MouseX event to detect 2 inputs and set appropriate settings. Will definitely try through Tick Event and see what happens.

Thanks.

I’ve made a post on forum and posted a video to explain this more clearly. Hope this helps understanding problem. Maybe I’m just not doing it correctly but I hope video will clear things up to show exactly what problem is I’m having and maybe there’s a solution for me. Or maybe it’s a bug?.

Hey Obihb,

Sorry for delay in response. There are a couple of issues that are preventing you from getting what you want:

  1. There was an issue with mouse focus that made a click necessary before cursor updates were processed. This was reported in TTP# 331391 and has been fixed in 4.5. So if you use, for example, Show Mouse Cursor bool to update whether cursor is visible, it will update on next tick. You can already see this in 4.5 Preview.
  2. There is a separate issue with mouse data nodes not updating during pause. I have entered a new bug report in our system for that (TTP# 349081) so developers can take a look at it.

In 4.5, I set up a simple test case to show how I would set this up:

As you can see, using SetShowMouseCursor and GetInputMouseDelta on Tick (or Timer) eliminates need for a number of extra variables and cleans things up significantly. Unfortunately, until we have a fix in for mouse data updating during pause, this won’t work precisely how you need.

I’ll let you know when I see an update on that second issue. In meantime, please let us know if you run into other issues with this that I may have missed.

Hope that helps!

Thank you very much for all your efforts. I’ll certainly check this out today and see how it goes.

Thanks again.