UMG isn't working after clicked outside of it.

Hi!

I have checked my “Advanced Vehicle Kit” project in 4.15 Preview to make sure it’s working, so i can mark it compatible on the marketplace but, i think i have found a bug which can make the UMG not working/responding to any input.

Clicking outside of a button or just on the screen where, there is no UMG/Widget, the mouse cursor disappears and the UMG lose it’s focus.

After that no matter if you call a “Show Mouse Cursor” and/or a “Set Keyboard Focus” function the mouse cursor will appear but the UMG will not work from now on, only if i press the Shift+F1 (which you can’t if you make/run a build of the project) key combination when the mouse have appeared.

Any help is appreciated!

Hi

I am having trouble reproducing this issue on our end, I have a couple questions that will help me narrow down what issue you are experiencing.

  1. Can you reproduce this issue in a blank project?
  2. If so could you provide a detailed list of steps so I could reproduce the issue on my end?
  3. Could you provide screenshots of your widget and other associated Blueprints?

Thank You!

Hi, ThomasVanZeeland!

Yes, it seems i’m able to reproduce this issue in a blank project.
These are the steps to reproduce it:

  1. Made a blank project with 4.15 Preview.

  2. Created a new widget blueprint and added two buttons.

  3. Added a “OnClicked” event to those two buttons which just writes a print string out that they were pressed.

  4. After this, in the Level Blueprint i called the “Create Widget”, which then stores to a variable that widget, when the “BeginPlay” event triggers.

  5. Then, i assigned two keys with the “Add to Viewport” and “Remove from Parent” functions with a “Show Mouse Cursor” function.

If needed, i can make a video on how to reproduce it.

Also, here are the screenshots of the Blueprints.

Using the steps you provided I was able to reproduce your issue.

What you need in your Blueprint is a set input node, these nodes can give focus to both UI and the Game as needed. From the steps, you posted to fix the issue I did the following:

  1. After “Set Show Mouse Cursor” on your F Key Pressed event I added the node “Set Input Game and UI” The Target is the Player Character and the In Widget to focus is the Widget variable you made
  2. After “Set Show Mouse Cursor” on your G Key Pressed event I added the node “Set Input Game Only” this node will restore focus to the game

hello hello!
I had a similar issue.
Try to add the node Set Visibility when calling up the UMG Widget
I hope it will help

324683-ue4editor-rsnfwft7hi.png