4.9 UI swallows mouse events

I just upgraded to 4.9 from the latest 4.8.
Different from 4.8, 4.9 the UI swallows mouse events, even if there is no visible widget. This menu is composed of several UserWidgets, all their canvases cover the whole screen.
The lamp actor in the middle should receive OnBeginCursorOver(), OnEndCursorOver() and OnClicked(), which is not happening anymore. Worked perfectly yesterday with 4.8.
If I hide the whole menu (SetVisibility(ESlateVisibility::Hidden) ) the messages come as expected.

56674-deadactor.jpg

Please see the attached image.

Hello ,

I was unable to reproduce this issue on our end. I have a few questions for you that will help narrow down what issue it is that you are experiencing.

Quick questions:

  1. Can you reproduce this issue in a clean project?
  2. If so, could you provide a detailed set of steps to reproduce this issue on our end?
  3. Could you provide screen shots of any blueprints that may be involved with this issue?

Experiencing this as well, sporadically, moving an object around fixes it sometimes. Trying to isolate the issue.

Moving some objects closer to the camera seems to fix this issue. For others it doesnā€™t work.

Some of my objects are animated using timeline, they do not get mouseover events when not animated, but do get mouse overs when timeline is playing.

Hello mxnko,

Could you go through and answer the questions that were asked to ? These questions will help narrow down what issue it is that you are experiencing.

I will take screenshots later today. Didnā€™t have any luck reproducing it in an empty project - seems to work.

Hello mxnko,

Would it be possible to receive a zipped down simplified version of the project that is having this issue?

sorry for not checking back sooner and thanks for your effort.
I did some more testing and found out:

Even if the menu does not have any widgets at all and also does not have a canvas the problem still persists. Only hiding or collapsing it allows for mouse messages to reach the actor in the world.
Extensively clicking on the actor lets it receive OnBeginCursorOver() and OnEndCursorOver() sometimes, but never OnClicked().

Could reproduce it!
The steps to go:

1.) Create a FirstPerson example project in 4.8
2.) Convert it in place to 4.9
3.) Set up the PlayerController to receive mouse events using this tutorial: Mouse Control Setup | Unreal Engine Documentation

4.) Create a C++ based Actor and add mouse event handling (see ā€˜MyActor.cppā€™ in ā€˜Source.7zā€™)
5.) Create a BP Actor based on C++ class MyActor.
6.) Change the AFirstPersonGameMode.cpp like in ā€˜Source.7zā€™, so that a BP Actor is spawned and mouse cursor is shown in StartPlay()

7.) Disable AFirstPersonCharacter::OnFire(), (see ā€™ AFirstPersonCharacter.cppā€™ in ā€˜Source.7zā€™)

8.) Create a UserWidget BP. Add nothing to it. Canvas only in enough.

9.) Create BP from your AFirstPersonCharacter if not already there.
10.) In the BP of AFirstPersonCharacter at event StartPlay spawn the UserWidget BP, set it to viewport, and SetVisibility to hidden.

11.) Compile and Start simulation. There should be a box spawning near the player. If you hover the mouse over the box, the cursor should change. If you click on the box, it should disappear.

12.) Change the BP of AFirstPersonCharacter. set the visibility of the UserWidget to visible.

13.) Compile and start again. This time the box should not receive mouse events.

the ā€˜txtā€™ is a7z zip file. So rename it from ā€˜txtā€™ to ā€˜7zā€™. Your system didnā€™t allow me to upload a 7z

Rudy,

Thanks for taking your time. I am not an expert, but Iā€™ve slimmed it down to 700mb zipped and 1.3gb unzipped. Canā€™t share publicly, but have private link via dropbox.

You can email me and Iā€™ll reply back via max at fullbeast . com

ok, I boiled down the project as much as possible and uploaded it (25MB):

When loading it in the editor, it will ask you to rebuild missing dlls. Just rebuild, it should work.
When the editor opens,it will complain about missing content in the StarterContent. Just ignore the warning, the projectile will not be instantiated.

To test:

1.) start simulation. A box should fall down near your character.

2.) hover the mouse over it. Mouse cursor should change. Click on it. Box should disappear.

3.) Stop Simulation.
4.) open Blueprint: /Game/FirstPerson/Blueprints/FirstPersonCharacterā€™
5.) At the end of the execution queue of Event Begin Play SetVisibility to Visible
6.) Compile and restart simulation.
7.) The box does not react to the mouse now as it should be. This is the bug.

The menu that is created at 5.) is just a UserWidget that contains a canvas. It is probably swallowing all mouse events to the world.

Hello DeChris,

After looking over your project I was able to find that this issue you are are experiencing (in the project provided) is due to the widget being set to visible. The canvas panel by default is set to ā€œSelf hit Test invisibleā€ This means that it is ā€œvisibleā€ to the player but only as art (does not consume click events) and that it only effects itself (not its children). This means that when you set the widget to visible (as seen in the screen shot from your project below) it will set all widgets in the widget blueprint to ā€œVisibleā€ this includes the canvas panel. The ā€œVisibleā€ setting allows widgets to interact with the cursor. This means that it will then consume mouse inputs. You will need to make sure that the canvas panel is set to ā€œSelf Hit Test Invisibleā€ to avoid this problem. I hope that this information helps.

Issue is caused by:

Make it a great day

1 Like

Nope, that wasnā€™t it.
Checked it in my main project. Set all canvases to SelfHitTestInvisible by hand after changing visibility.
Bug still remains.
Btw this would have meant a major design change, because in 4.8 the canvas obviously didnā€™t change visibility with itā€™s parent widget, because everything works like a charm.

Ok, Iā€™ll stick to 4.8 until someone fixes it.
Thanks for your help anyway and have a nice day.

Solved it!
I previously tried to set only the canvases of the menus to EVisibility::SelfHitTestInvisible, but that didnā€™t do it. Setting the whole menu instead of canvas worked like a charm. Interestingly itā€™s buttons still work if menu is set to EVisibility::SelfHitTestInvisible, so visibility seems not to be propagated through hierarchy.

Thank you!