Animation montage playback with support for speed control, stop conditions, blend out, and end callbacks.
// Simple playback
playAnimation(skeletalMeshComponent, myMontage, FName("Attack"));
// With speed and end callback
playAnimation(skeletalMeshComponent, myMontage, FName("Attack"),
[](float delay) { /* started, will last delay seconds */ },
1.5f, // speed
nullptr, // no stop condition
0.3f, // stop blend
nullptr, // no breaker
FCBP_montageEvent{nullptr, [](UAnimMontage* m, bool interrupted) {
// montage ended
}}
);
// With stop condition: stop as soon as bShouldStop becomes true
playAnimation(skeletalMeshComponent, myMontage, FName("Walk"),
nullptr, 1.0f,
[this]() { return bShouldStop; }, // stop condition
0.3f // blend out time
);