Chorded Actions not triggering properly

Hello Unreal community !

I’m trying to work with Enhanced Input Actions and gamepad, but I’m facing a situation in which I can’t make inputs work the way I want.

Here’s what I’m trying to achieve :
In my game I control a first person character, and I can use the mouse to look arround, or the keyboard arrows to look arround more precisely (by using a scalar Modifier on arrow inputs).
At the moment, I’m working on making my project compatible with gamepad controllers, and to handle my various inputs, I decided to use key combinations : in this case, right thumbstick to look arround, and left trigger + right thumbstick for precise look. From what I’ve seen arround on the internet, they key is to use Chorded Actions, so I tried this way :

My InputIA_mod is defined in an other Input Mapping Context, and added to my controller with an higher priority :

The problem is, it seems my “precise look” action is never triggered on gamepad. I found a workarround way by creating a new input action, and defining the chorded action trigger in this new action, but that means creating a new mapping in the mapping context, handling an extra input event…

Is there something I’m getting wrong here, or is this the way to do ?

Thanks in advance !

I think you are over thinking it (or I’m not understanding what you are saying). This is what I did to create a ZOOM function for Third Person (basically the code shortens the boom).

I wanted to use L2 and Right Stick up/down for Playstation.

First I define what the heck L2 is, because Unreal uses it’s own terminology which is not intuitively obvious.

Note: This doesn’t actually say what key L2 is, just that sometime in the future it will be defined and everyone will be happy. Think of it as defining variables. We don’t say what the variable contains, just that it exists.

Next, I defined a IA_Zoom which is just this. Easy Peasy.


Note: It is here I say it is chorded with IA_L2 (which was defined above). Okay, cool. Also I found that consuming the input (unlike L2) didn’t send anything. So there was much sad.

At this point we have defined our variables. Now we have to tell the system what those will contain.

So now I get to say what IA_Zoom consists of (the Right Thumbtack 2D Y axis). Note that since I said it was chorded in the IA_Zoom, that is reflected here.

Next I have to say what the heck an “L2” is (because Unreal doesn’t know). I just tell it that it is the Gamepad Left Trigger Axis (which makes totally no sense).

At this point, compile and, everyone is happy.

The rest is pretty anti-climatic.

Triggered runs while L2 is held down for after 0.5 seconds (as I read this). I then take the value of the joystick and break out the Y and use that to zoom in and out.

Whether this is right or not, I don’t know. I quite literally have 30 minutes of expertise on it. But it’s pretty wicked cool and I really like the system.

I think you are attempting to work against the system: the system creates a new input action for, well, different input actions.

The goal is to REDUCE the spaghetti the is created by the old system for very complex actions. This means that every unique set of key presses will result in a new input event. This is by design.

5 Likes