Hmm after looking it up, OnFinishedPlaying isn’t the UFUNCTION(BlueprintNativeEvent) I assumed it was.
I have no idea how to use a FFlipbookFinishedPlaySignature…
That said, you could declare a C++ function:
UFUNCTION(BlueprintCallable, Category = “Any Category Name”) void CustomOnFinishedPlayingCall();
You can then connect that function to the OnFinishedPlaying Event in the blueprint.
Its kind of a loopy work around: (C++)OnFinishedPlaying -> (Blueprint)OnFinishedPlaying -> (C++)CustomOnFinishedPlayingCall()
But it does technically let you code behavior for that event in C++.
You can even add returns and arguments to the function with no problems:
UFUNCTION(BlueprintCallable, Category = “Any Category Name”) int32 CustomOnFinishedPlayingCall(float Infloat);
I haven’t been able to figure that out either. But Programmatically if you want to skip around blueprints in general. A good Algorithm would be to set up your character and NPC’s on every Tick, Check to see if your FlipBookComponent is Playing(). If it is not, Turn SetLooping() to True and Call the Play() function before changing your Characters Animation State. Then for things like Attacking. Change Your Character to Their Attack Animation and set SetLooping() To False. That way your attack animation is the last to play and Once it Ends, The Next Tick will Turn it Back on
Sorry for Necro, but I was also wondering how to use OnFinishedPlaying and this thread is about the only topic that shows up.
Since calling AddDynamic has no effect on OnFinishedPlaying, I ended up creating an FScriptDelegate Object that you can use for the OnFinishedPlaying multicast like so:
First, declare your handler function in the header. It must be a UFUNCTION but it does not need any modifiers:
This way, AnimationCompleteHandler will actually be called when the animation is complete. I hope this helps anyone else who is looking for the solution.