I am using a screen space widget, and I am trying to use the mouse cursor to click a UMG button added to the viewport / HUD but using the gamepad instead of a mouse. The joystick moves the mouse cursor and the buttons detect when the mouse is hovering, but inputting A/X on the gamepad won’t click the button.
Is it maybe a better approach to use the screen position of the mouse and then on A/X press find if there is a button at that screen position?
In my limited experience… To register button clicks in widgets you have to setup an input override function “on key pressed”. In the blueprint, on the functions tab there’s a little box that says “override” you’ll find it there.
This is not true. If OP is truly gamepad pressing native UMG buttons as they say, not only is this not needed, but one is also unable to do so since buttons consume input. If you override mouse down in a user widget, a native button will prevent you from using it. You’d need to set the button to Precise Click or rewrite it.
I mean, create a widget with a button, add it to the viewport, place the cursor over the button, press gamepad button. The clicks register, and so does spacebar, for example - and we do not need to set this behaviour up in any way.
@jacksonnexhip if the standard behaviour is not working for you, you’d need to provide details step to reproduce the issue. What else is going on, do you juggle Input Modes?
Perhaps I’m not fully understanding what he’s doing, in my setup, I have widget tick tracking the mouse cursor(Wich I have setup joystick controls for if the player toggles input option) setting focus if over a child widgets, input ovveride checks if input == gamepad bottom face the fires click event. Maybe an unconditional approach but I found it on a tutorial and it works for my needs. Note: my game is solo player, so I utilize pause and input mode game and UI on construct, witch may not work in many other situations
That I am clicking with a gamepad. This requires no script or additional setup. You’d need to go through some trouble to make it not work while being able to highlight it.
Yes - to demonstrate that it does, indeed, work with a gamepad. I don’t understand the question. Create a new widget with a native button, add it to the viewport, place the cursor over it and use the gamepad to click it.
This is the most fundemanetal functionality that has worked since UMG was introduced 10 or so years ago…
While the UMG support for controllers is lackluster in general, this part works. There’s also a plugin in case you want to use esoteric controllers and reroute input. Maybe OP is using something non-standard.
Using a PS4 controller, it absolutely does not just “click” when you press X. Can the next person who tries to help point us towards an actual function that we can use to force the game to “click” for us? I’m using enhanced input and have beaten my whole game with a controller. I have standard buttons.
My pause menus let me move the cursor around with the controller but I can’t get clicks to work, despite the insistence that “haha it just does.”