How to get User Widget under cursor

I’m trying to create a workaround for the lack of gamepad support for UMG. Currently I’m using FAnalogCursor to be able to use the thumbstick to move the cursor, like in the example from Nick Darnell.

I removed all the movement code so the cursor doesn’t move. I also created a new base class for UMG widgets that contains references to the widgets to switch to when moving the stick or using the D-pad.

Now I want to snap the cursor to the next widget based on the current widget. I want to do that in the analog cursor, which should grab the current User Widget (my custom class), then process input based on the direction of the stick, or the D-pad.

Can I get the current widget below the cursor, as my custom User Widget class? And then get the axis values of the thumbstick to determine which widget to switch to?

EDIT: Almost forgot: I’ll also need the widget’s position to snap the mouse cursor to.

1 Like