Mouse click on button in widget component works in PIE but not in standalone

For my main menu I have a 3d widget component acting as the menu which contains buttons that do different action, like get to the game. This whole setup works in PIE but when I play it in standalone or package the game it no longer works. The buttons get the Hovered, Unhovered, Pressed, and Released events but never get the Clicked event. The widget component has Receive Hardware Input enabled, changing the player controller’s click and mouse settings doesn’t affect it, Use Mouse For Touch is disabled, the widget interaction component doesn’t affect it, and changing the input mode doesn’t affect it.

Thanks for the help,

Alex

I’m bumping this because I have searched everywhere with every permutation of phrasing I can find… to no avail.

My last search which brought me here pretty much sums up the situation:
ue4 widgetcomponent click works in pie but not in shipping (or standalone either for that matter)

bReceiveHardwareInput is set to true.
Enable Input was called for the Player Controller
Set Input Mode Game And UI also called.

The thing is, everything works flawlessly in Play In Editor.
But in a shipping build, the widget buttons hover (change color), and play their sounds (hover and surprisingly click too) but the attached click event is never called.

The same widgets work fine in shipping as regular non 3d widgets, its only in WidgetComponent mode that the problem occurs.

Im currently on UE4 build 4.26.2

Is there some further mouse capture shenanigans that i need to do in standalone/shipping, which isnt required in PIE perhaps?

…And to update my particular situation:
I found a workaround

// I replaced this:
ActionButton->OnClicked.AddDynamic(this, &UActionItem::ButtonClicked);

// with this:
ActionButton->OnPressed.AddDynamic(this, &UActionItem::ButtonClicked);

So basically, I hooked the OnPressed event instead of the OnClick one.
That seems to have restored pretty much what I had working in PIE.

3 Likes

Thanks god you saved me. 2024 in 5.2 still have this issue.