How to Disable a Function for x time after Action/Montage has been played? (UE 4-27)

I’ve been having a hard time figuring this out, I have created a dash/launch character animation. But I want the player to be unable to use the dash/launch function for x amount of time after the roll action/ montage is active. Here is my setup now, however this doesn’t work as I’m still able to dash/launch character when the roll animation is active. Any help appreciated

So to sum it up, how do I disable my character from dashing when the roll animation is playing or has been activated. Thanks

If you start something which works for some time you might use a boolean variable to have two states

  1. It’s not in the process
  2. it’s in the process
    Then you can use the variable to prevent do something else

Hi Lorenzo, thank you for the reply. This was somewhat what I had in mind, and looking at my screenshot you will see that I turn the return of the playmontage at the top into a boolean called can dash, I then put the boolean into a branch with the false output set to the dash animation, however this doesn’t seem to be working, as it still allows me to dash while the roll animation is playing, causing visual bugs.

I noticed that you didn’t connect branch with “Can Dash”

Thats because, you set your variable “Can Dash” to true, but nowhere in that part you set it to false again :wink: so your branch will check that “Can Dash” variable, which right now will always be true → allow to dash.

Try this: Go between your InputActionRoll and your sequence TimerSys, there set your “Can Dash” variable to false, also go to the End of your Roll code and chage your set “Can Dash” = true, so that it is triggered by your Play montage “On Completed”, instead of “On Notify Begin”. Reason being, that Play montage already have a timer installed (it has the tiny clock symbol at top right corner for timer/delays), that will trigger, once the animation is completed, and not sooner → the perfect moment to allow dashing again.
Also reconnect your branch, that actually checks for your “Can Dash” variable → change the flow so that it goes from your branch, that checks falling, from its false into your branch, that checks “Can Dash”. And you might want use the "true"out put from that branch, since you only want dash, if “Can Dash” is set to true.

With that, the moment you press your InputActionRoll, you automatically set your variable to false, so that even if you then press yourDash button, it won´t play, because the “Can Dash” is still set to false. Only at the end of the Play Montage it will be set to true again, allowing dashing again.

1 Like

Thank you so much, Suthriel &. You have taught me something new, and made me grasp a new concept when it comes to visual blueprint coding!