• Runtimes
  • How to verify if an animation will trigger a specific event?

I have some audios to play separately from the animation, but some animations should have an event "soundtrigger" to notify when I should play it.
I can bind to the AnimationEvent but I couldn't find if this animation have this event.

This works, but I'd like to make the bind only if the animation have this event

UTrackEntry* animation = SkeletonAnimationComponent->SetAnimation(0, animationNameToPlay, false);
if(!animation->AnimationEvent.Contains(this, "PlaySoundInWait"))
   animation->AnimationEvent.AddDynamic(this, &AMyPawn::PlaySoundInWait);
Related Discussions
...

You can iterate the animation's timelines, for each one that is an EventTimeline check getEvents to see if the event's data is your sound event. You really only need to check the first event's data, as event timelines that come from the Spine editor always have events with the same EventData.