Download

Button Modifiers Question

Hey there,

I am trying to create a system that uses the same button for multiple InputActions. Let me explain what I mean,

Scenario:

My prototyping game has a feature that allows the player to change their pawn mid game, let’s say that that is fine and not the problem. To be able to change character however, requires the user to hold the Left Bumper of the gamepad, and then use either A,B,X or Y to select their character. Holding LB slows down time (also not a problem), to allow them to choose their character.

My problem is, that when I set the A button (or any other button really, because B, X and Y would be attacks etc) the character still jumps, even when my InputAction is set to change the character.

I know that I have not told the engine to stop using the A button to jump, but this is intentional, as I still want to use the A button to jump in game, I want to be able to hold LB (effectively blocking the Jump InputAction), and then select the character from there, not having the character jump when in this ‘Slow Motion Mode’, as it conflicts with the character swapping etc. So how could I ‘block’ the Jump InputAction temporarily, while LB is held?

Any ideas? I have messed around with having Boolean variables to no avail, and it is doing my head in as I just cannot solve the problem XD

Anyway, thanks for your time, I hope this can be solved and benefit others! :slight_smile:

Create a “Shift” bool. Set it to true when LB is pressed and false when LB is released.

For each potentially changed input event in your blueprint, make the first thing the event feeds be a branch, with the condition set to the “Switch” bool. This way, if “Switch” is true (which it only is if LB is pressed, since releasing it sets it to false) the button does one thing, and it does the other thing if “Switch” is false.

You can still have LB feed the slowdown logic (and the menu call for the player select, for instance) this way as well, it just sets/unsets the variable before starting that part of the BP.

Thank you very much! I will try this as soon as I can! :smiley:

And it worked! Thank you so much!