0
\$\begingroup\$

Based on an answer I received on this question:

How to make an action perform only after an animation has run?

I am using notifications in animations to perform certain commands/actions.

See in the documentation:

https://docs.unrealengine.com/en-US/Engine/Animation/Sequences/Notifies/index.html

Before resorting to this site, I researched elsewhere for something about modifying the animation speed and the closest question I found was this:

https://answers.unrealengine.com/questions/509654/how-do-you-change-the-ratespeed-of-animation.html

Simply changing the speed of the animation, I know how to do it, but I want to control its runtime. Sort of determining how much time the animation has to play.

In the image below I show more or less the scenario I have:

enter image description here

Note that the notification happens at the end of the animation (where I apply the damage).

So based on the speed I set for animation to perform, every time it's finished the notification happens, applying the damage.

It turns out that the animation doesn't necessarily have the exact duration of an attack starting when the other one ends (the image below will make it easier to understand):

enter image description here

There is one more scenario I imagined.

In the latter case, assuming the animation is (usually) 1 second long, and the character has the maximum attack speed (I set the maximum to 2 attacks per second). So the animation would be running 2 times faster:

enter image description here

But the attack speed will not always be a "simple" number, I would like to know how to calculate/set it time so I have no problems when the attack speed is any number.

I want to know how to set the animation runtime and a time interval between the animation running.

\$\endgroup\$
  • \$\begingroup\$ Divide the wait time by attacks per second modifier. Animation has a “playback speed” property called rate - which you would like to multiply by the attacks per second rate in case your animations are always 1sec long. \$\endgroup\$ – ColdSteel Sep 19 at 17:20
  • \$\begingroup\$ @ColdSteel I modify it where exactly? BP player, BP anim player? Inside or outside the state machine? \$\endgroup\$ – Boneco Sinforoso Sep 26 at 0:10
  • \$\begingroup\$ @ColdSteel I saw that you can make this dynamic change in execution speed on the state machine. I happen to need to know the exact animation time at standard speed and I don't know how to figure it out. \$\endgroup\$ – Boneco Sinforoso Sep 26 at 0:18
0
\$\begingroup\$

To find out the duration of the animation, just open it and look at this part of the screen:

enter image description here

Another way to find out the duration is to divide the total number of frames by the framerate.

In my case:

180/24 => 7.5

In the player animation blueprint on the state machine you will see an option called Play Rate (click on the pink circled location in the picture below):

enter image description here

This way you will be able to change the animation speed using the variable and constant values (State Machine):

enter image description here

\$\endgroup\$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.