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"

Set Input Mode Game and UI disables game input

Hello everyone. I'm trying to create some dialogue widgets in my game that can be used alongside the actual gameplay. It's a 2D game, so I want dialogue boxes to appear while the player is still able to move around and so forth. The dialogue boxes will be controlled with different keys to the ones used to move the character in game, so there's no control confusion.

I thought this would be doable with the Set Input Mode Game and UI node, but when I use this, control is taken away from the game and only works in the widget. When I click outside of the widget, control returns to the game but is taken away from the dialogue box. I want the player to be able to control both at once eg. hit the "continue" key on the dialogue box while continuing to move through the level.

I should also note that I am using widget components to create the dialogue boxes, but as far as I know the controls for the widget class should work the same.

Any help would be greatly appreciated.

Product Version: UE 4.10
Tags:
more ▼

asked Apr 26 '16 at 03:39 AM in Blueprint Scripting

avatar image

Rhiannonnee
18 8 13 15

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

1 answer: sort voted first

Hi.

So it's probably safe to assume that either one can have the focus at once but not both.

That said, nothing stops you from retaining a variable to your widget currently in viewport and capturing the key presses in the game e.g. player controller, and then acting on the widget by either calling into it from the player controller, or better, using variable binding from the widget into the player controller.

So first, when you create the widget and add it to viewport, save it to a variable in your player controller, game mode or wherever.

Then In the widget, if it's about position, you can bind the position to a function which taps into the game mode, player controller or wherever. Otherwise the key captures in the player controller can call function in the widget or act on the widget directly.

Hope this helps :)

more ▼

answered Apr 26 '16 at 04:15 AM

avatar image

keyle
1.8k 66 27 90

avatar image Rhiannonnee Apr 26 '16 at 05:57 AM

Thanks for your answer Keyle. So do you think my best option is to create some custom events/functions in the widget blueprint, and call those events via the NPC that the player is talking to? (The NPC actor is what spawns the widget in the first place)

(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