Warning: file_get_contents(/data/phpspider/zhask/data//catemap/4/macos/10.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
2d 在“虚幻引擎4”中,动画书完成动画后是否有停止动画书的方法?_2d_Unreal Engine4_Unreal Blueprint - Fatal编程技术网

2d 在“虚幻引擎4”中,动画书完成动画后是否有停止动画书的方法?

2d 在“虚幻引擎4”中,动画书完成动画后是否有停止动画书的方法?,2d,unreal-engine4,unreal-blueprint,2d,Unreal Engine4,Unreal Blueprint,当动画书在虚幻引擎4(2d)中结束动画时,我试图销毁它。然而,我似乎找不到阻止动画书的方法,你能帮我吗 动画书设置动画后,是否有方法停止动画书 我对虚幻有点陌生,我到处都能找到选择。这是我必须通过图形编程来完成的吗?查看哪些可以帮助您设置动画的状态。这里有一个我的实现示例,我知道为时已晚,但我希望它能帮助您 void AHeroCharacter::UpdateAnimation(){ const FVector PlayerVelocity = GetVelocity(); con

当动画书在虚幻引擎4(2d)中结束动画时,我试图销毁它。然而,我似乎找不到阻止动画书的方法,你能帮我吗

动画书设置动画后,是否有方法停止动画书


我对虚幻有点陌生,我到处都能找到选择。这是我必须通过图形编程来完成的吗?

查看哪些可以帮助您设置动画的状态。

这里有一个我的实现示例,我知道为时已晚,但我希望它能帮助您

void AHeroCharacter::UpdateAnimation(){
   const FVector PlayerVelocity = GetVelocity();
   const float PlayerSpeedSqr = PlayerVelocity.SizeSquared();
   const int32 PlaybackPositionInFrames = GetSprite()->GetPlaybackPositionInFrames();
   const int32 FlipbookLengthInFrames = GetSprite()->GetFlipbookLengthInFrames();
   UPaperFlipbook* DesiredAnimation;

   if (GetCharacterMovement()->IsFalling()) {
        DesiredAnimation = JumpAnimation;
        GetSprite()->SetFlipbook(DesiredAnimation);
        if (PlaybackPositionInFrames == FlipbookLengthInFrames - 1) GetSprite()->Stop();
        return;
   }

   GetSprite()->Play();
   if (PlayerSpeedSqr > 0.0f) {
        DesiredAnimation = RunningAnimation;
        GetSprite()->SetFlipbook(DesiredAnimation);
   }
   else {
       DesiredAnimation = IdleAnimation;
       GetSprite()->SetFlipbook(DesiredAnimation);
   }
}