# How i can create this is ability input system?

**URL:** <https://forums.unrealengine.com/t/how-i-can-create-this-is-ability-input-system/1261087>\
**Category:** Blueprint\
**Tags:** Input, Ability-System, unreal-engine, Blueprint, question\
**Created:** [August 14, 2023, 8:36pm UTC](https://forums.unrealengine.com/t/how-i-can-create-this-is-ability-input-system/1261087 "2023-08-14T20:36:03Z")\
**Posts on this page:** 9\
**Page:** 1

<div class="post-metadata">

**Author:** ![blAddddDe](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@blAddddDe](https://forums.unrealengine.com/u/blAddddDe)\
**Post date:** [August 14, 2023, 8:36pm UTC](https://forums.unrealengine.com/t/how-i-can-create-this-is-ability-input-system/1261087/1 "2023-08-14T20:36:03Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![Astrotronic](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/astrotronic/32/1194566_2.png) [@Astrotronic](https://forums.unrealengine.com/u/Astrotronic)\
**Post date:** [August 14, 2023, 9:40pm UTC](https://forums.unrealengine.com/t/how-i-can-create-this-is-ability-input-system/1261087/2 "2023-08-14T21:40:37Z")

</div>

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)

 ![enumz](https://d3kjluh73b9h9o.cloudfront.net/original/4X/0/a/8/0a873e7c2e89010893daaa9a8b2a3abc7881ba60.png)

Let us know if you have any questions about this.

---

<div class="post-metadata">

**Author:** ![AreWeGaming](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/arewegaming/32/1174860_2.png) [@AreWeGaming](https://forums.unrealengine.com/u/AreWeGaming)\
**Post date:** [August 15, 2023, 5:46am UTC](https://forums.unrealengine.com/t/how-i-can-create-this-is-ability-input-system/1261087/3 "2023-08-15T05:46:50Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![blAddddDe](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@blAddddDe](https://forums.unrealengine.com/u/blAddddDe)\
**Post date:** [August 15, 2023, 6:13am UTC](https://forums.unrealengine.com/t/how-i-can-create-this-is-ability-input-system/1261087/4 "2023-08-15T06:13:03Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![Astrotronic](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/astrotronic/32/1194566_2.png) [@Astrotronic](https://forums.unrealengine.com/u/Astrotronic)\
**Post date:** [August 15, 2023, 3:22pm UTC](https://forums.unrealengine.com/t/how-i-can-create-this-is-ability-input-system/1261087/5 "2023-08-15T15:22:00Z")

</div>

@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.

---

<div class="post-metadata">

**Author:** ![AreWeGaming](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/arewegaming/32/1174860_2.png) [@AreWeGaming](https://forums.unrealengine.com/u/AreWeGaming)\
**Post date:** [August 15, 2023, 5:16pm UTC](https://forums.unrealengine.com/t/how-i-can-create-this-is-ability-input-system/1261087/6 "2023-08-15T17:16:45Z")

</div>

This is what i meant [Screenshot - 5f68161531dca37894a91c339c6fd1f9 - Gyazo](https://gyazo.com/5f68161531dca37894a91c339c6fd1f9) and after all the code is done you can just collapse to a function

---

<div class="post-metadata">

**Author:** ![Astrotronic](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/astrotronic/32/1194566_2.png) [@Astrotronic](https://forums.unrealengine.com/u/Astrotronic)\
**Post date:** [August 16, 2023, 3:26pm UTC](https://forums.unrealengine.com/t/how-i-can-create-this-is-ability-input-system/1261087/7 "2023-08-16T15:26:32Z")

</div>

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

 ![5f68161531dca37894a91c339c6fd1f9](https://d3kjluh73b9h9o.cloudfront.net/original/4X/1/4/c/14c060b91253172507cc6a99cfe22b75a060b47d.png)

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.

---

<div class="post-metadata">

**Author:** ![blAddddDe](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@blAddddDe](https://forums.unrealengine.com/u/blAddddDe)\
**Post date:** [August 18, 2023, 7:10pm UTC](https://forums.unrealengine.com/t/how-i-can-create-this-is-ability-input-system/1261087/8 "2023-08-18T19:10:04Z")

</div>

Thank you for your reply

---

<div class="post-metadata">

**Author:** ![blAddddDe](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@blAddddDe](https://forums.unrealengine.com/u/blAddddDe)\
**Post date:** [August 18, 2023, 7:10pm UTC](https://forums.unrealengine.com/t/how-i-can-create-this-is-ability-input-system/1261087/9 "2023-08-18T19:10:47Z")

</div>

Thank you for your reply.
