Enhanced Input context switch bug

Hi,

We were trying to re-use the aim assist modifier from Lyra for prototyping and I encountered an issue affecting modifiers when you switch context with enhanced input.

<br>

In IEnhancedInputSubsystemInterface::RebuildControlMappings, towards the end of the function there is a section of code that will override the new mapping with the old mapping to preserve input state. While preserving the state is necessary, overriding the new mapping with the old will cause any new modifiers and triggers to be lost.

In our case, we were trying to apply a new input mapping context when in ADS. The new mapping context uses a different aim assist modifier on the right thumbstick however it never gets applied because the modifiers from the default context are preserved.

Can you confirm whether this is a bug and if the proposed fix makes sense? (see attached images)

Best,

Fran.

Steps to Reproduce
Apply aim assist modifier to a default context and then add a new input context with a different aim assist modifier that has stronger values.

Hey there! Thanks for this report. This is indeed a bug, and it is pretty long standing in Enhanced Input. I’ve filed Unreal Engine Issues and Bug Tracker (UE\-270589) which you will see when it goes public.

Your change seems reasonable, but will require some thorough testing before we add it to the engine in case folks are “accidentally” relying on this broken behavior.

In the meantime, feel free to make a pull request and post it here if you would like to share it with the community.

Thanks,

Ben

Hi Ben,

Apologies for the late reply I was on holidays. I have opened a PR with: https://github.com/EpicGames/UnrealEngine/pull/13144

Best,

Fran.

Thank you for making that pull request! I’ll get it triaged and check it out.