How to check if animation has finished?
Hi! I am playing an animation on a skeletal mesh component by using the following code:
where m_pMesh is of type USkeletalMeshComponent* and s_pAnimJump is of type UAnimSequence*.
This plays the animation perfectly! But I would like to know when the jump animation has finished so that I can play the free-fall animation. Does anyone know how to find the remaining time?
asked Dec 10 '15 at 06:27 PM in C++ Programming
If you wait for the animation to end, and then play the other, you'll get a little hitch, so I would take a bit of time off:
Now you can set a timer or something to kick off the next step. For example:
I recommend that instead of using m_pMesh->PlayAnimation(s_pAnimJump, 0); you use:
Because montages have the nice blend-in, blend-out feature, return the anim length right off the bat, and have many convenience functions such as pause and skip to section. If you don't want a hitch between animations, simply account for the blend-out time.
answered Dec 11 '15 at 03:03 AM
There is a method called IsPlaying() in USkeletalMeshComponent that will tell you if any animation is currently playing.
answered Dec 11 '15 at 02:18 AM
Follow this question
Once you sign in you will be able to subscribe for any updates here