UMG 4.5 Gamepad Firing Hover Button Events

Hi,

Our game use UMG heavily for it’s ui and use Gamepad for the input. Say I have a button which has a different display when hovered with mouse. How can I use gamepad to trigger that OnHover state on the button? Like when we press up/down on the gamepad, buttons would alter its style between hover normal, pressed, etc.

Is my approach correct? Or should I use another method? My goal is probably calling the hover functions on c++ or something along with set the button bIsHovered boolean flag, but I can’t find any doc about this

Thanks for the help

Hello, just for curiosity, is this going to be supported on 4.6?

Hello ernesernesto,

I have an example of a way you could use your game pad to “highlight” your buttons. The following example cycles through 3 buttons (highlights the next button down every time I hit the down key) changing them to their hovered state by setting their normal state to look like the hovered state. I have also attached my blueprints in note pad form. You can copy and paste them straight from the wordpad to your blueprints. Blueprints 1. [YourWidget][1] 2. [PlayerController][2]

Things that you will need.

  1. Widget blueprint
  2. Player controller
  3. 5 buttons (in widget blueprint)

In the player controller:

In your widget designer tab:

In the Event graph of your widget

I hope this helps.

Make it a great day

Hi ,

Thanks for your effort and time! This hover problem could be achieved using your method probably, but I was looking for something that could be bindable like this, on the designer panel.

20712-enabled.png

I can’t find way to make isHover and isSelected show up on this panel, is unreal going to be supporting this? What if I want this as a feature request on 4.6? Since this could save a lot of blueprint work :slight_smile:

Anyway, going to try this solution, thanks !

Hello

I have submitted a feature request ( UE-5270) to the developers. I hope that my example allows you to continue your progress on your project. I will provide updates with any pertinent information as it becomes available.

Make it a great day

Great help !, thanks again

,

Is there a way to reverse that Multigate when the Up button is pressed?

Hello CHADALAK1,

I have another setup that I have made that I can share with you. This one has more flexibility and also incorporates the up/down functionality. [Your Widget Example][1] This is the actual widget. I have provided it to you to help you along. This was made in 4.7 if you would like to add it to a project to take a look at it. You will need to unzip it and add it to the content folder of your project.

You will need to set up the following in the event graph of your Widget. The index only needs to be initialized as 0 outside the functions. To add more buttons you will need to increase the number for “Number of Btns”.

Here I have used one of the default functions (On Key Down) that are available to you in the My Blueprints panel under input. You will also see to custom functions that I will show you how to make. To add more buttons you will need to add new “Highlight Function” functions.

This is my “Highlight logic” function it will handle the logic that will be needed to change between buttons.

This is my “Highlight function” this is what will be used to fake the buttons being highlighted. To increase the number of buttons used you will need to add a new “DeSelect” pin and a new “Set Widget Style” node for each button added

Make it a great day

Hi ,

how do you made these connectors/points in your blueprints? THX

Bild hochladen

Hello stopschildgruen,

These are called rerout nodes, they are great for cleaning up your blueprints. You simply need to right click and type rerout. This should make it the first option. I hope this helps.

Make it a great day

following because this feature would be awesome :slight_smile:

Hello UnlikelyHeroesStudios,

After further consideration by the developers this feature will not be implemented into the engine. However, you could try using the “Has User Focus” node in combination with changing the image for the “normal” state of the button. I hope that this information helps.

52093-hasuserfocushelp.png

Make it a great day