x

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"

How do I properly set user focus on a 3D UserWidget via blueprints?

Kind Sirs,

How do I set keyboard focus to a 3D widget (that was not added to viewport) via blueprints? I have a UMG UserWidget, which extends a C++ UserWidget. bIsFocusable is set on the widget. The widget is placed on an Actor (via WidgetComponent) and placed in the scene/map.

I am trying to set the user focus on the widget, such that I can check "Has User Focus" in blueprints when listening for input. The goal is to get the keyboard to work on the menu (in 3D) without adding it to the viewport.

Some reference: Method for creating 3D Widgets from the tutorial no longer seems to work. Method for using WidgetInteractionComponent seems to only target mouse/look-at interaction, i.e. "The Widget Interaction component performs a Raycast to see if it hits a Widget Component placed in the world and if it hits one, you can set up rules to determine how to interact with it."

Here is what I've tried so far, both in the node graph of the Actor that houses the widget, called "LeftMenuPlane", (starting with Event BeginPlay, as shown, and in the node graph of the UMG widget itself starting with the "Construct" event. Unfortunately, when I check "Has User Focus" (as shown below) it always returns false, even after immediately setting it. Please advise.

Current ideas:

  1. Perhaps there is a way to simply hide the widget on the viewport after in fact adding it, i.e. by overriding some method in a custom HUD subclass & using that instead of the default? Which method would I want to override?

  2. Perhaps I can place a WidgetInteractionComponent overlapping some component within the widget in 3D in order to set keyboard focus on it? How would I do that? Will the user then be able to use the keyboard to switch focus to other components of the widget?

V1. Set Input Game Mode and UI Node

alt text

V2. Set User Focus

alt text

V3. "Set Input Game Mode and UI Node" followed by "Set User Focus"

alt text

Product Version: UE 4.14
Tags:
cond1.png (152.9 kB)
cond2.png (158.0 kB)
cond3.png (159.8 kB)
more ▼

asked Dec 27 '16 at 04:33 PM in Blueprint Scripting

avatar image

Algomorph
18 2 3 6

avatar image Algomorph Jan 11 '17 at 06:54 PM

Found some info on the matter here, here, and here. #3 presents a possible hacky fix, but that again isn't what I'm looking for because it involves mouse clicking. I want the focus to just be set on the widget by default, always.

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

0 answers: sort voted first
Be the first one to answer this question
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