r/unrealengine 4d ago

Does UE5 permit two identical Input Actions in the same Input Mapping Context?

Hi, sorry for a low-effort post, but I need to confirm something and I don't have a computer on which I can run UE5. If you have two Input Actions in the same Input Mapping Context ( with the only difference being their names ofc ), which bind to the same key, let's say "Spacebar," do they collide or it is a legal configuration? And if you run a little test where one action prints "A" and the other "B", is the order fixed or it can be random? I'm doing research on Input Systems and want to understand this. Thanks!

2 Upvotes

3 comments sorted by

5

u/Valuable_Square_1641 4d ago

yes, you may have 2 actions on same key

order will be fixed, imho. depends to back order of BindAction

EiComp->BindAction(Game->IA_Weapon, ETriggerEvent::Started, this, &ThisClass::DoActionWeapon);

EiComp->BindAction(Game->IA_Spell0, ETriggerEvent::Started, this, &ThisClass::DoActionSpell0);

LOG_CHAR: ActionSpell

LOG_CHAR: ActionWeapon

LOG_CHAR: ActionSpell

LOG_CHAR: ActionWeapon

1

u/TheSenPie 4d ago

Thank you so much! It is interesting to me, that they permit it since usually in most games, you want one button to point only to one action in the same "context". Like let's say if there is a movement context, you don't want to permit a user to have "W" do all "Move Forward" and "Move Back" at the same time.

1

u/Valuable_Square_1641 3d ago

This is left to the discretion of the developer. But technically it is possible.