UAnimInstance::DynamicMontage_IsPlayingFrom
#include "Animation/AnimInstance.h"
Access: public
Specifiers: ENGINE_APIconstBlueprintPureUFUNCTION
Description
Returns true if there is currently an active dynamic montage that was created from the specified animation asset. Used to check whether a one-off PlaySlotAnimationAsDynamicMontage call is still running.
Caveats & Gotchas
- • Dynamic montages are transient — they are created on-the-fly from an AnimSequenceBase and are not reusable UAnimMontage assets. This function cannot be used with regular montage assets.
- • If the same animation was used to create multiple dynamic montages, this function returns true as long as at least one of them is still active. There is no way to distinguish between instances using this API alone.
Signature
ENGINE_API bool DynamicMontage_IsPlayingFrom(const UAnimSequenceBase* Animation) const; Parameters
| Name | Type | Description | Default |
|---|---|---|---|
| Animation | const UAnimSequenceBase* | The source animation sequence to check for an associated dynamic montage. | — |
Return Type
bool Example
Guard against re-triggering a dynamic montage C++
void AMyCharacter::PlayHitReaction(UAnimSequence* HitAnim)
{
UAnimInstance* AnimInst = GetMesh()->GetAnimInstance();
if (AnimInst && !AnimInst->DynamicMontage_IsPlayingFrom(HitAnim))
{
AnimInst->PlaySlotAnimationAsDynamicMontage(HitAnim, FName("DefaultSlot"));
}
} Tags
Version History
Introduced in: 5.0
| Version | Status | Notes |
|---|---|---|
| 5.6 | stable | — |
Feedback
Was this helpful?