How would i do this?

Use UMG. Place images on the canvas. Place buttons + text blocks. Press button > play sound.

222379-abegamespeakpc.jpg

][1]

Could anyone show me how to do this? student needs to be done

I want to know how to do it say if i press 1 on the keyboard that button flashes and the sound is played

  • create your widget
  • make sure it’s Focusable and has Keyboard Focus
  • override onKeyDown and fire a CustomEvent
  • switch depending on which button is pressed

If you want buttons to flash, add them to an array and trigger the appropriate [widget animation][2]. It can be done in the same switch as above.

this is what i have atm so how would i do it if it is on the other blueprint? sorry not very good at unreal yet.

Hm, how would you do what, exactly? :slight_smile: I thought you were creating a menu… judging by the original post.

You’ll need to include more details. All I see is input that has nothing to the with a menu.

i have gamespeak and the sidescroller blueprint and i want it to be every time i press 1 or the other buttons the button flashes and the sound plays but i can’t get that to work because the input is on the the sidescroller blueprint. sorry for bad explanation just want the same as abe

Ok, it makes perfect sense now. In this case, it’s better not to override onKeyDown as I suggested above but propagate input from the character to the menu.

For this, you need a reference to the widget that we see above, is the widget created in the character blueprint?

No it just a user widget called gamespeak,

Well, yes. But you’ll need a reference to it eventually. I’m trying to help you. Where (in which blueprint) do you create this widget?

the input is in sidescroller blueprint and the widget is in the gamespeak blueprint

No, no. Gamespeak IS your widget. When you play the game, you want to display this widget to that player. Where do you call the node CreateWidget?

Or should I ask, how are you currently displaying this widget to the player while in-game?

its on the main menu widget it isn’t displayed in game

Being in the game’s menu counts as being in the game, perhaps I should have said during run-time or while the game is running. If you embedded this as a custom widget inside your MainMenu widget, then in which blueprint do you create the main menu?

At some point in your code, you used a node CreateWidget and you created Gamespeak widget and added it to the viewport:

223017-capture.png

Where, in which blueprint? Or you did this for the main menu which houses Gamespeak, where? In the controller? In LevelBlueprint? In GameMode?

That node is in the main menu widget, in the level blueprint I only create the title screen

It took ages to get that info from you… :slight_smile: But I still do not understand how you organised the whole thing as you seem a bit reluctant to share.

It boils down to this:

When you create the menu in the LevelBlueprint, create a reference to it (right click on the ReturnValue > Promote) and send it to your SideScrollerCharacter (create a variable inside of the same type). The character will now be able to access the menu.

When you create Gamespeak widget inside the menu, do the same as above. If you just placed Gamespeak as a custom widget, you already have a reference so this step can be skipped.

The SideScrollerCharacter will be able to access Gamespeak through the MainMenu widget which stores its reference.

Good luck.

Have you got any screenshots?

link text