How do i get a animation to play slower if i am holding a button

Hi, i am making a few combos and i want to implement a charge attack that makes the anim slower but does more dmg etc i have tried global time dialation cant get it to work can anyone help ?

Hi, Jakupiii.

If you are using an Anim graph you can expose Play Rate as a pin, so you can slow the animation down that way.

If you are doing it within blueprints then there is a play rate node that you can set.

Hope this helps, Tom.

Hey Thanks, i cant get this to work can you show a quick example ?

Hey Jakupiii, follow Illarvan’s example and then add the example from my picture to whichever blueprint that is implementing the ability’s functionality.

Make sure you remove the Tick Event and replace the Print String with the “Set Play Rate,” plugging the float output from “Get Input Key Time Down” into the float input of the Rate in the Set Play Rate node. Make sure you use “Get Player Controller” and drag from the controller’s output, otherwise you won’t be able to access the “Get Input Key Time Down” node.

You may also need to preform some sort of math with the float in order to get the correct functionality, like a divide or multiply depending on your situation

If you want to know how long the key is being pressed, then my example will print to the screen the amount of time the key is being pressed.

Thanks guys this helped alot im almost there to what i want, but how would i make the anim stop when its finished charging and when the button releases continue the attack or would i need 2 animations?

Im trying to make something like this dmc attack called ‘drive’ and ‘overdrive’ @0:40 DmC: Devil May Cry All Moves - YouTube

Also did i do this right ?

Okay so I’m not sure if this will work or not but it might. Essentially, you will need to play around with the different Montage Functions in your game in order to get the exact desired functionalities from them. For example, I don’t know if you should stop or pause the montage. Your set up is almost there, except you probably do not need the Set Play Rate Node as it refers to the current animation being used by the Locomotion in the Animation Blueprint and not the Montage being played and the Montage has it’s own Play Rate Input. Now since I don’t have access to a physical example at the moment I cannot test this out for myself nor do I have the time to do so right now but I hope this will send you on the right path.

If you want functionality of when the Key being pressed is released, then just drag off the “Released” execution node and it will fire whenever the Key is released.

To get the animation to stop you should look into anim notifications, or as frostdog mentioned; montages.
I don’t have any montages in my animations, so I’ll post one way to do it with just animations.

Setup the key you want holding down in your character blueprint, with a variable that can be set.

129961-hold1.png

Next. add a notify in your animation.

Expose the play rate on your animation in your AnimGraph, and plug in a variable.

Finally in your AnimGraph Event Graph add the notify event like so. Basically what this will do is pause your animation while the key is held, and then continue playing it once it is released.

Hope either this or FrostDog’s set you on the right track :slight_smile:

So thanks for the answer again <3 much appreciated i really thought this was going to work cause its simple but it doesn’t pause the montage… im about to lose it.
thanks anyway il keep trying

I cant get this to work either-_- almost got it working with set play rate but im getting errors in my attack state it must be wrong ?
sorry to bother you guys again very sorry

Your target isn’t connected here.

yes i did that and didnt work but i made a custom event in charbp then called it to animbp and worked perfect!, Thanks so much IIIarvlan and FrostDog i wish you guys all the best thank you.