Using two InputActions at the same time

Hello, might be a noob question here but here goes

I have a sprint action and a flashlight action

Holding sprint causes the player to sprint, releasing stops sprint
Flashlight action toggles the flashlight on and off

Both work good separately but when I try to sprint AND use flashlight action then I just keep sprinting without any effect on the flashlight.

I’ve spent the last 30min trying out different combinations and I can’t come up with an answer, if it’s obvious (or not), please share what you know.

Edit: Unreal Engine 4.27

Are those enhanced input actions? If they you set those actions to trigger on debug keys, that’s an expected result. Though if they are enhanced input actions, place Print String nodes that will print different words (or have different colors) after those input actions’s “triggered” pins respectively. If you don’t see them both getting printed out on the top left of your screen but rather only one, that could be a hardware limitation. Most likely because you’re not using a gaming keyboard.

This might be a pretty rough way to go about it, but I believe there is a node for “wait key released” you could use this and a timer to decide witch action to activate. Alternatively EIA has settings for combo and chain input action sequences, you could play around with those to achieve your desired result

It’s UE 4.27 so I don’t think it has enhanced input, there’s no menu for input when creating assets.

I tried printing it and predictably only sprint shows up.

Would you mind sharing your keyboard model? Is it a gaming keyboard?

Enhanced input is in 4.27 but it is in beta there. Not every feature is present (combos are rather limited or even missing if I remember correctly)


change to

Make sure the plugin is enabled

You can then create the mapping context and input actions in 4.27
obraz

and mapping context (usually hooked up to begin play)

Thank you everyone for the quick replies but I found a solution.

I packaged the project because I wanted to test framerate and for some reason the keys work at the same time now :sweat_smile: :sweat_smile:.

Yeah it’s really weird but I’m glad that it works.

(clarification: they work at the same time in packaged game, not in editor, but that’s fine)

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.