How do I reuse input methods for in-game menus and other things like that

Hi there, just a general input question here. I have a set of inputs binded to various things; the usual things like character movement, interaction and jumping.

What’s the process for reusing these inputs for in-game menus. Just say, I want the ‘A’ button on my controller to jump but also for selecting things in an in-game menu.

I’ve read a bit about the ‘enhanced input’ options that are going to be the default in 4.27 and that seems like a good approach, where you can have different modes for different scenarios.

What’s the usual way everyone has been doing it so far in the engine? I got some code working fine but it was strange using my ‘Jump’ input to make selections so that’s probably not the right way to do it haha.

Thanks a lot.

Hi!
What I’d suggest that you do ( which was explained in an Unreal Learning video ) is that you create different groups, even though they use the same buttons, for different actions.
So you can avoid using ‘Jump’ to select an item, or other actions: as if you character is in a car, for example.

Enabled enhanced input plug-in and use input mapping contexts with different priority index for menus / gameplay.

1 Like

Hi there, Ive managed to convert my project over fully to use the Enhanced Input plug-in. Everything works fine as so thanks for suggesting it.
How do I actually go about dynamically changing the Input Mapping Context during gameplay?
I’ve read over the documentation at Enhanced Input | Unreal Engine Documentation but I can’t grasp how to do it.

I’ve read the bit where it says,

With your Input Mapping Contexts added, your Pawn is able to respond to any Input Action events you bound in SetupPlayerInputComponent , or that Blueprint Scripting users have set up. If events occur during gameplay that warrant changing the set of available Input Mapping Contexts, you can use ClearAllMappings , AddMappingContext , and RemoveMappingContext to update the set of available commands dynamically. Check the IEnhancedInputSubsystemInterfaceIEnhancedInputSubsystemInterface API reference page for more information.

but where do I call those functions from and how? How do I actually use the priorities?

The plugin is a Subsystem: