RealDocs

UAnimInstance::Montage_GetSectionChangedDelegate

function Engine Since 4.0
#include "Animation/AnimInstance.h"
Access: public Specifiers: ENGINE_API

Description

Returns a pointer to the FOnMontageSectionChanged delegate for the given montage instance, allowing inspection or late binding of a section-changed callback.

Caveats & Gotchas

  • Returns nullptr when the montage is not playing or has already ended. Always null-check the result.
  • The pointer's lifetime is tied to the FAnimMontageInstance — it becomes invalid as soon as the montage instance is destroyed at the end of playback.

Signature

ENGINE_API FOnMontageSectionChanged* Montage_GetSectionChangedDelegate(UAnimMontage* Montage = nullptr);

Parameters

Name Type Description Default
Montage UAnimMontage* The montage whose section-changed delegate to retrieve. Nullptr returns the delegate for the topmost active instance. nullptr

Return Type

FOnMontageSectionChanged*

Example

Check and bind a section delegate after play C++
FOnMontageSectionChanged* SectionDelegate = AnimInstance->Montage_GetSectionChangedDelegate(AttackMontage);
if (SectionDelegate && !SectionDelegate->IsBound())
{
    SectionDelegate->BindUObject(this, &AMyCharacter::OnMontageSectionChanged);
}

Version History

Introduced in: 4.0

Version Status Notes
5.6 stable

Feedback

Was this helpful?

Suggest an edit

Select a field above to begin editing.