We’ve been encountering an issue that seems related to how inputs (enhanced input) and UI focus interact with each others, we’re currently working on the version 5.4.4 of the Unreal Engine.
I’ve been able to reproduce it in a Third Person Shooter unreal template without any addition.
The issue:
In our game, whenever an input is hold on a controller (I am using a gamepad for reference), and pause is invoked (Pausing game, displaying UI, setting focus to Widget, Set Input mode, Add UI Mapping Context, Remove Gameplay Mapping context etc…), and then game is resumed, the input that is being held goes through Start, Ongoing, complete state at every frame; thus repeatedly triggering itself at every frame.
This issue is present in Builds and Editor.
I’ve attached a project (Blueprint Third Person Shooter) where I’ve reproduced this issue.
Inside this project, I’ve added a Widget (to be created, and focusing a button inside), and few nodes mapped to “End” key on pressed and release inside of the player character BP of the template.
I did a bit of testing with this and found the following things:
-It looks like this is more of an issue where holding a key on the widget -> then removing it results in the behavior you’re seeing.
--The reason being; Holding jump on gamepad then pressing and releasing pause key only has the problematic behavior when starting PIE and after alt+tabbing out and back into editor
--Subsequent repeats (letting go of jump and releasing pause key then retrying it) results in jump returning to ongoing
--I’m seeing the issue consistently when holding pause key -> then press and hold jump -> let go of pause key
-On 5.6, as a workaround at the end of the key released, adding a flush input seems to fix this problem
-I tried setting up a toggle for pause instead of hold, and setting input modes with flushing, but that unfortunately didn’t seem to work with 5.4 but does in 5.6
If updating to 5.6 is not possible or if you’re looking for another workaround I can go ahead and escalate this to Epic to see any other ideas they may have.
First and foremost, thank you very much for your answer.
On the project we are currently working, it is not planned to update the version of the engine to 5.6. We will, unfortunately, have to deal with the issue on 5.4.
It would be very appreciated if you could bring the issue up to Epic to see if we can manage a workaround on 5.4.
I’ll check the hacky workaround in more detail as it could come in handy, however we’d like a reliable solution if possible.