人物攻击
我在.h头文件中添加了三个Montage:UPROPERTY(EditAnywhere,BlueprintReadWrite)
UAnimMontage* PiKan1Montage;
UPROPERTY(EditAnywhere,BlueprintReadWrite)
UAnimMontage* PiKan2Montage;
UPROPERTY(EditAnywhere, BlueprintReadWrite)
UAnimMontage* PiKan3Montage;
然后在cpp的PiKan函数里添加
void AOneCharacter::PiKan()
{
if (PiKan1Montage != NULL, PiKan2Montage != NULL, PiKan3Montage != NULL)
{
UAnimInstance * AnimInstance = Mesh1P->GetAnimInstance();
if (AnimInstance != NULL)
{
AnimInstance->Montage_Play(PiKan1Montage, 1.0f);
AnimInstance->Montage_Play(PiKan2Montage, 1.0f);
AnimInstance->Montage_Play(PiKan2Montage, 1.0f);
}
}
}
请问为啥它只会执行PiKan1Montage呢?
只写montage2呢 mknmknmk 发表于 2017-11-22 12:09
只写montage2呢
那样的话,只会播放第二个蒙太奇 本帖最后由 mknmknmk 于 2017-11-30 09:58 编辑
使用 TQueue<> 结合Timer 或者 Update 可以 播放依次播放Tqueue 里的东西;
元素是自定义结构体 ,结构体元素有Montage, duration, 剩余时间。timer 或者 Update 减少剩余时间。 到0时 dequeue
https://forums.unrealengine.com/development-discussion/c-gameplay-programming/15793-play-aninimation-form-c-how-to-get-current-and-remaining-time
页:
[1]