Stan
(Stan)
November 9, 2015, 2:54pm
1
I need to pause/resume animation from animation blueprint( derived from custom UAnimInstance) Animation is playing from State Machine (not Anim montage). And it should be preferably done from c++ code
What is the best way to do it?
Thanks in advance
1 Like
MickD777
(MickD777)
November 9, 2015, 3:11pm
2
I would use the GlobalAnimRateScale on the SkeletalMeshComponent. You can see that the animation is ticked that way in the code:
AnimScriptInstance->UpdateAnimation(DeltaTime * GlobalAnimRateScale);
GlobalAnimRateScale is public so you should be able, from your custom AnimInstance, to simply do this :
GetOwningComponent()->GlobalAnimRateScale = 0.0f;//Pause
GetOwningComponent()->GlobalAnimRateScale = 1.0f;//Resume
I havent tried it myself, but this should work!
Mick
Talad
(Talad)
May 5, 2024, 5:46pm
3
Inside the character class, I used
GetMesh()->bPauseAnims = true;
which is the same as you can see in the editor, when you open the character, under Animation there is a “Pause Anims” flag.