Is it possible to assign a movement to a button using triggers?

Hi, I was able to activate a movement that was permanent using a trigger. Say for example my character jumps higher since he has found a jump ability. But I thought it would be the same with keys. Like pressing the “Z” key doesn’t do anything until the player finds the dash ability that would enable the player to press “Z” key to activate the dash.

Anyone has an idea how I can implement this using Blueprint in UE4.8?

Set up a custom Event in your player blueprint that’ll activate dash. Then from the level blueprint once the character overlaps the trigger send a cast to the player that calls the custom event that activate dash.

In player Blueprint
“ActivateDashEvent” → Set CanDash = TRUE

In Level Blueprint
OnBeginOverlap → Cast to Player → Call ActivateDashEvent

Just set up a branch with your input action Z and that should work.

It’s always going to go through because your branch is always true. Your condition has a check mark which means its always going be true. You gonna have to make a bool variable plug it in the branch and when the player walks on the trigger the variable gets set to true. On default it should be false. You might want to start watching the great Unreal Tutorials. They have over 100 tutorials on how to do everything. Beginner to Advance.


As for the Cast to Character just plug in the “Get Player Character” into it.

Hi thanks for the answer. I have made a custom event for the super sprint and it kind of works but it activates itself as soon as I press the R-Trigger on the gamepad. I’d like it to do nothing until the character passes through a trigger first. Any idea why it activates itself right away?

Here’s my setup.

Also although I understand when you say “CastToPlayer” and “Call SuperSprint” but I miss where and what variables I should put up there… it worked for the super jump because I only had to modify the Zvelocity but this is more tricky… thanks again!

Thanks it worked for the super sprint it doesn’t activate itself… didn’t think about the “false” option from the branch… as for the cast, putting get player character in there crashes the game every time I get through the trigger…
it says:

Error Infinite Loop detected in ThirdPersonCharacter , asserted during Branch with the following Call Stack

I will follow the massive tutorial I need it thanks for the link!