Help with Enhanced Input and Gameplay Abilities System

Hi. I’m currently following this documentation but it’s kind old and things are different for me since I’m using the new Enhanced Input system. So even following that, things got kind messy and I want to now if there’s something more updated.

1 Like

Here is an example of how I am doing it:

My actions have triggers for both Pressed and Released, then I just use the bool value to check which one was called. Hope that helps!

Thank you. I see your bindings were done in the SetupPlayerInputComponent but the oddest thing in my project is that when I activated the Enhanced Input Plugin my SetupPlayerInputComponent function stoped being called. So I had to move everything to the PlayerController class and just that make everything little harder.

I have even try to debug with a breakpoint but the game doens’t call it, neither in a Pawn class

Strange, haven’t you override something on the PlayerController and forgot to call the Super function on it? Here everything is working nicely.

Do you have any override input function on your PlayerController? I thought that disabling this function in PlayerController and leaving it only on the pawn would work but it doesn’t. I also thought it might be that option to auto receive input in Pawn but my PlayerController is working with it disabled.

Ensure that your game mode is correct with the correct character and controller set.

Everything seems okay. The main focus of the thread wasn’t even that but before you show your code I realize my project has problems. I’ll keep trying to find the solution for that and keep in touch when I come back to the ability system. Thank you

From your screenshot, seems like you have the wrong Default Pawn Class set:

1 Like

Lol. Last night I was messing around with your suggestion and forgot to change back to ActorMovement. But I tried and nothing changed.

Can be something related to this?

Well, I changed to use the default game mode stuff and only changed the character and the SetupPlayerInputComponent is being called correctly. And if I use the same settings as yours, I get it called twice for some reason.

So the issue is coming from somewhere else.

Do you have any overrides in your Controller class? Not forgetting to call Super anywhere? I know I asked that before, but just confirming as this seems to be the only doable option here.

Check every override function you have in the Controller and in the Character class.

1 Like

Yes, I really forgot to call Super LOL. Sorry for that, I’m new to Unreal. I’ll stick back to the thread purpose and test now the Gameplay Ability System. Before I start messing arround I’d like to mention that my game uses a party system holding three classes of characters, each one with their own unique abilities. What would be the best approach to keep them all responding to the Ability Inputs but still casting their own unique abilities?

1 Like

You can hold a TSubclassOf for each input and just set those for each class, this is similar to how I am dealing with a similar situation in my case.

1 Like

So, I’ve implemented the Ability System in the way you’ve shown and works perfectly. Thank you, a lot. I would like to ask you how the ability should work, because when doing some testing I realize the ability is called just once, even keeping pressing the button.

When debugging everything was fine, the “value” was true in every button press

You should call EndAbility at some point, or else the ability will remains active forever

1 Like