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
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