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"

Moving a selection icon with keyoard inputs

I am very new to Unreal Editor and I'm struggling to get the basics. All I want is to move an onscreen icon using arrow keys and to select using the enter key or somesuch. I have a menu screen set up already with new game/continue etc. on it, but I don't know what to use to just simply scroll through selections using the arrow keys, similar to an NES game, or even what to use as a cursor (just an image? something else?). Thanks in advance

Product Version: UE 4.13
more ▼

asked Sep 20 '16 at 03:00 PM in Blueprint Scripting

avatar image

Pumpkin Man
3 2 4 3

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

1 answer: sort voted first

Hey Pumpkin,

I think what you're looking for is the UMG Widget. This will allow you to have multiple images/icons/buttons in your viewport that you should be able to organize and move in the manner of your choosing.


more ▼

answered Sep 20 '16 at 05:03 PM

avatar image

639 21 9 35

avatar image Pumpkin Man Sep 20 '16 at 05:10 PM

Here's the thing, though. It turns out that I do have a UMG Widget, I just don't now how to actually program in the blueprints to get something like, "when down arrow key is pressed, move icon from 'continue' to 'new game.' What blueprint things would I add? Thanks for answering this, though.

avatar image Mookaroni Sep 20 '16 at 05:22 PM

Oh I see.

I looked around and I believe this is what you're looking for: https://answers.unrealengine.com/questions/147619/umg-gamepadkeyboard-navigation-in-umg-menus.html

In essence, in the same place that you add your widget to your viewport you need to 'Set Keyboard Focus' as well.

avatar image Pumpkin Man Sep 20 '16 at 05:39 PM

Can the widget I want to move just be an "Image" or does it have to be something else? I generally am pretty quick to learn with these types of softwares; it's just a matter of understanding the lingo and finding where everything is. I know my little cursor icon image is a widget, I just don't know where to find "Set keyboard focus" or what to do with it when I do, but I can probably figure that out when I get to it. Sorry for my noobishness.

avatar image Mookaroni Sep 20 '16 at 06:01 PM

For your case, it should be a button rather than an image. You can change how the button looks to show your image with the added functionality of having events like 'OnClicked'.

After your 'Add Widget to Viewport' node, just draw out another line and look for 'Set Keyboard Focus'. You might have to untick Context.

avatar image Pumpkin Man Sep 20 '16 at 06:17 PM

So I'm not necessarily making the button's image move; I'm just having four different buttons in which I'm using the keyboard to scroll between and "click" on via the enter key, etc.

avatar image Pumpkin Man Sep 20 '16 at 06:27 PM

Also, I've been able to set up Add to Viewport and Set Keyboard Focus, but that's all I got. I don't know how to connect it to my buttons, or how to make it so that pressing down will scroll down...

avatar image Mookaroni Sep 20 '16 at 06:36 PM

If Add to Viewport and Set Keyboard Focus is all you've implemented, they COULD be working, it's just that you can't tell.

You need to also implement some way to show which button you're on.

This image is from the link I posted above. This will let you see exactly which button is focused https://answers.unrealengine.com/storage/attachments/42960-keyboard2.png

avatar image Pumpkin Man Sep 20 '16 at 06:54 PM

Urgh! I have everything that the image has, and I even figured out how to change it so that if false the image would be completely dark and if true the image would be completely visible. However, the For Each Loop's Array Element doesn't want to connect to the Set Color and Opacity's Target. It's also saying that the type of [0] through [3] is undetermined, and I need to connect something to imply a type. Hoo, boy... And all I wanted to do was to make a main menu...

avatar image Mookaroni Sep 21 '16 at 06:26 AM

Make sure that the array is an array of Buttons. Also, the Set Color and Opacity should be 'Target is Button'. If you have these two correct, then they should be able to be wired together.

A main menu is pretty simple, its just that what you're looking for (buttons interaction with WASD) takes a little more effort.

Don't give up yet hah

avatar image Pumpkin Man Sep 21 '16 at 12:36 PM

Although I do have the array of buttons, the Set Color and Opacity says that the target is "self," and it adamantly refuses to be changed, no matter how much double-clicking, right-clicking, or anything I do. As a side not, I fixed my array problem by deleting the array widget and just redoing it. Go figure.

avatar image Pumpkin Man Sep 21 '16 at 08:14 PM

OK! I managed to get my stuff to look like the picture! I had to delete the Set Color and Opacity, then recreate it by dragging the line from ForEachLoop out and creating it from there. I have yet to see if it actually works.

avatar image Pumpkin Man Sep 20 '16 at 08:58 PM

Thanks for your help, though. I feel that you've done more than enough.

avatar image Pumpkin Man Sep 21 '16 at 08:20 PM

alt text here's my blueprint. I hit the "play" button, but hitting the arrow keys, wasd, or even just clicking on my buttons does nothing to their images. At all. And where exactly do I program which key does what? I think I know what everything does except the Event Tick thing.

capture.png (108.2 kB)
avatar image Pumpkin Man Sep 21 '16 at 09:49 PM

Another question: this looks like all it does is say "when this button is highlighted, make it a different color." Is this true? And if so, how do I program the arrow keys to actually make it scroll through each selection (e.g. when New Game Button is highlighted and I press "up" on the keyboard, move to highlight "continue" button.)

(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