Search in
Sort by:

Question Status:

Search help

  • Simple searches use one or more words. Separate the words with spaces (cat dog) to search cat,dog or both. Separate the words with plus signs (cat +dog) to search for items that may contain cat but must contain dog.
  • You can further refine your search on the search results page, where you can search by keywords, author, topic. These can be combined with each other. Examples
    • cat dog --matches anything with cat,dog or both
    • cat +dog --searches for cat +dog where dog is a mandatory term
    • cat -dog -- searches for cat excluding any result containing dog
    • [cats] —will restrict your search to results with topic named "cats"
    • [cats] [dogs] —will restrict your search to results with both topics, "cats", and "dogs"

UMG: When a Widget has focus, Action Mappings aren't handled on the Player Controller

There is a problem with UMG where if you focus a Widget, the Player Control will no longer handle action mappings. For example, I have a Player Controller in my game that handles a custom action mapping that I have defined, PauseButtonPressed. Upon pressing the button the first time, I show the menu and set focus to it. However, if I press the pause button again, it won't un-pause. From what I can tell, the Player Controller doesn't handle input events at all when a widget is focused.

Is there some way around this, or is this just a bug? It seems like it would be nice to have this as an option on the Player Controller, or maybe on specific action mappings that you wan't handled all the time. Thanks in advance!

Product Version: Not Selected
more ▼

asked Oct 27 '14 at 09:20 PM in Blueprint Scripting

avatar image

41 3 6 9

avatar image dataenroute Jan 09 '15 at 11:21 PM

I'm having the same problem. The focus issue is fixed so I don't have to click once to focus my inventory widget, but then the action mappings no longer work so I can no longer close my inventory again. I have been debugging this the last couple of days and am no closer to finding out the problem, which leads me to believe this may be a problem with the 4.6 engine update.

avatar image BaronPumpky Jan 09 '15 at 11:32 PM

Sorry, I misposted a second ago:

What I actually ended up having to do was handle the specific button press to "unpause" on the UMG widget itself, since you can't handle the action mapping there or on the player controller at that point. This is a temporary solution, especially if the action mappings are going to be user customizable, but it works for now.

avatar image dataenroute Jan 09 '15 at 11:38 PM

Ok, I was going to say that I am already handling it in the player controller. So you added a key binding in the widget itself? Do you have a screen by chance? I haven't done key bindings in UMG yet. I've handled the UI action mappings in the player controller up to now.

avatar image dataenroute Jan 09 '15 at 11:46 PM

I need to do some more testing but I think I actually just got mine working. Rather than using UI only as the input mode, I swapped it to the Game and UI and then unchecked the mouse and cursor options, which seems to keep it from rotating the camera when not hovering over the inventory. I will post later today after I run more tests to verify this.

avatar image BaronPumpky Jan 09 '15 at 11:48 PM

Oh okay great! Let me know if you need any more help.

avatar image dataenroute Jan 10 '15 at 12:11 AM

Would you mind posting your BP with the key binding? I am now having the problem where my weapon fires if I don't click on an interactable UI object, so this is not a full fix for me and I need to do some other key bindings in UMG later anyway. Thanks for the help! I will still post back when I get it fixed.

avatar image Derjyn Jan 29 '16 at 12:15 PM

Been struggling with this for a few hours (maybe days, things get blurry for me) and after reading a lot of posts, tutorials, the basics... I didn't find anything. I'm on 4.10 and this "issue" still exists there, really glad to come across your advice about setting input mode to Game and UI. Fixed my issue! Thanks a ton!!

avatar image xlar8or Feb 26 '15 at 04:30 PM

Also want to know how to fix this ! I can't put action mappings on the Event Graph of the UMG Widget so right now the only way to close the menu is to force it to a specific key event or having a Close button. It's a temporary fix, but it's not acceptable for a released game.

avatar image BaronPumpky Feb 27 '15 at 05:03 PM

Same! I'm still using the same temporary fix. We need to get some Nick/Rudy up in here :)

(comments are locked)
10|2000 characters needed characters left
Viewable by all users

2 answers: sort voted first

Easier temporary fix that adds no overhead and should be easy to remove if/when this issue is fixed in the engine: Add a button that covers the entire canvas, set Alpha to 0 in all states, put at very low z order to act as a catch-all so control is never passed to player controller. I have used a similar principal with panels in WinForms and it seems to work just as well here.

more ▼

answered Jan 13 '15 at 12:06 AM

avatar image

51 3 6 15

avatar image Jinks67 Apr 07 '17 at 07:41 AM

Thanks. I'll take that over firing a constant event tick.

(comments are locked)
10|2000 characters needed characters left
Viewable by all users

If you are pausing the game at the same time, then input is being frozen because the Player Controller is not receiving events. The simple way of handling this IMO (keeping on/off stuff in the same class) can be done by selecting your Action Mapped event for unpause in the Player Controller and Select "Execute when Paused" in the properties.

For reference: http://i.imgur.com/uGTbwly.png

more ▼

answered Apr 09 '16 at 11:12 PM

avatar image

26 1 4 6

avatar image cj.allen321 Feb 18 '18 at 11:15 AM

Thank you for posting this, big help! I'd not noticed this tick box.

(comments are locked)
10|2000 characters needed characters left
Viewable by all users
Your answer
toggle preview:

Up to 5 attachments (including images) can be used with a maximum of 5.2 MB each and 5.2 MB total.

Follow this question

Once you sign in you will be able to subscribe for any updates here

Answers to this question