UE-62606: Confirmed 4.20 bug for focus on TextFields (only shows up in packaged builds)

Found this bug (UE-62606) in the bug database, and it matches our own experience:

Unreal Engine Issues and Bug Tracker (UE-62606)

Our widget components for in-world UI are no longer accepting focus for keyboard input in packaged builds. Calls to blueprint nodes “Set Input Mode UI Only” or “Set User Focus” do not result in a text field being focused, or responding to keys pressed. Running in-editor gives the expected results. We’ve confirmed that this problem did not exist in 4.19, and begins once importing it to 4.20. We also see the same problem with a fresh proof-of-concept project in 4.20.

This feature is essential for UI in VR. We use it for the experience moderator entering the user’s email and name at the beginning of an experience.

Same problem here, good to hear they’re aware of it.

I had a similar issue with buttons and it led to this ticket:

https://issues.unrealengine.com/issue/UE-62154

So this looks like a general issue with 3D widgets, and a big one. I hope they fix it fast, my game is entirely unusable when packaged. I’ve already lost weeks and given the work i already did with 4.20 i can’t go back to 4.19, this is quite frustrating.

Yeah. I wasn’t much fun to be around this last week at work - it really took me about this long to track down what was causing this. It was kind of a perfect storm of obfuscating variables (our first multiplayer project, initially only showing up on the “client” so I thought it was a multiplayer issue, etc.) Nice to see that it wasn’t just me.

In the meantime, let me know if you find a workaround. I’d love to have a way to move forward in 4.20

For the buttons, you can use OnPressed instead of OnClicked, but no idea about other widgets.

Source:

https://answers.unrealengine.com/questions/813093/420-3d-widgets-non-clickable-in-standalone-game.html

Doesn’t help much with typing into text fields though. We’d literally have to write our own keyboard logic and manipulate the string value of the text field.

I’ve got a workaround! Try this:

I also have a widget interaction component always pointing at it. But the combination of Slate.EnableFastWidgetPath, the interaction component, and the delay before setting focus does the trick!

Oh wow, this is gold, a thousand bravos and thanks !

As a test on my game, once in standalone, i just opened a console and typed de slate command manually, and it worked.

So maybe that’s enough ? Did you try to simply delay the console call and doing nothing else ? Or execute the console command after the widget setup ?

Thanks again for finding and sharing that !

I needed the delay between the console command and the call to setting focus - something about the initialization order.

I can’t take total credit - there was a contact at Epic that helped us. I had tried both the delay and the fast widget path idea, but never both at the same time. :wink:

You definitely need to set focus after the console command and not before. But that command only needs to be done once - at the beginning of your application.