Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save dorgonman/bb8107f72aee7a695586bebfa0983cc6 to your computer and use it in GitHub Desktop.
Save dorgonman/bb8107f72aee7a695586bebfa0983cc6 to your computer and use it in GitHub Desktop.
UE4_GAS_OnPredictiveMontageRejected
PredictionKey.NewRejectedDelegate().BindUObject(this, &UAbilitySystemComponent::OnPredictiveMontageRejected, NewAnimMontage);
void UAbilitySystemComponent::OnPredictiveMontageRejected(UAnimMontage* PredictiveMontage)
{
static const float MONTAGE_PREDICTION_REJECT_FADETIME = 0.25f;
UAnimInstance* AnimInstance = AbilityActorInfo.IsValid() ? AbilityActorInfo->GetAnimInstance() : nullptr;
if (AnimInstance && PredictiveMontage)
{
// If this montage is still playing: kill it
if (AnimInstance->Montage_IsPlaying(PredictiveMontage))
{
AnimInstance->Montage_Stop(MONTAGE_PREDICTION_REJECT_FADETIME, PredictiveMontage);
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment