How i can create this is ability input system?

Hello, I would like to know how to make such an input system. There are 3 buttons 1,2,3(they select different abilities), and when, for example, you press button 1, there are buttons Z,X,C(abilities taken from 1), and if I press 2, there are abilities taken from 2 and the keys will be the same Z,X,C. For example, button 1(fire ability), I press 1, and appear Z(fire arrow),X(fire fist),C(fireball), I hope it is clear.
Im using UE 4.27

Hello,

For people using UE5, the new Enhanced Input System allows for adding/removing ‘Input Mapping Contexts’

For UE4, I just came up with this for using an Enumerator to switch contexts. (You’ll need to create that Enumerator Asset and apply it in the Variable Type)

Let us know if you have any questions about this.

You can make conditions like when you press 1 it will set a Bool to Enabled and then on the Z,X,C have a branch that has the Bool condition and when it go to true it will allow you to use those keys

Thanks for the solution, I think it will work, but I have on buttons 1,2,3 can completely different abilities from the list (fire, water, air, earth, etc.), and they in turn already have other abilities on buttons Z,X,C

@AreWeGaming This would work if there were only ever 2 states/contexts, but the good thing about having an Enum is you can have more than 2 (but still a limited/specific number) of states. - And there is less room for error than trying to do this using/comparing Text Strings.

@blAddddDe Not sure what you mean, In my example 1 and 2 would switch between Fire and Water context, and then the Z X C keys would check the current context and execute the correct spell.

This is what i meant Screenshot - 5f68161531dca37894a91c339c6fd1f9 - Gyazo and after all the code is done you can just collapse to a function

Thanks for sharing that. I’m going to post your image here so that it does not get erased if it disappears from gyazo.

That’s probably how I would have done it before learning about Enumerators. And it’s true that you can just sweep it under a function and it will work the same.

But it lacks a certain robustness + ease of use. You’d be juggling those bools and working with large node paths of branching logic, one mis-set bool, or a reference to the wrong boolean in a branch would break things.

Thank you for your reply

Thank you for your reply.