Game Logic inside AnimBP Event Graph

Heya,

I am setting up a combat system in which the player can do a series of 1-2-3 attacks. The attacks are driven by a montage as far as the animstions are concerned and all is well. The montage has a few notifies to signify at which point in the animation input for the next attack in the series is available. What this means in practice is that my event graph accesses my custom CombatComponent and sets bAbleToQueueAttack to true.

This is a matter of some concern as I am attempting to keep my animBP event graphs “read only”. Game logic shouldn’t depend on them. Is my approach or my concern valid? Is the “right” way to do this the more elaborate animnotify BP which I’d listen to in my player BP?

I am typing this on my phone so apologies for any mistakes, I hope I managed to clarify what I meant.

Thanks in advance!

Hey DamirH,

One way of doing this is to cast the notify event signal to your PawnBP.

You can do this by first creating a CustomEvent in your Pawn BP (then compile).

Go to your AnimBP Event Graph and create a notify event. Then add a “Try Get Pawn Owner” node. Drag off the return value and create a “Cast To [PawnBPName]” node. THEN drag off of the blue cast pin and call the Custom Event from your PawnBP.

Does that help?

1 Like

I actually haven’t thought of that version. I got sidetracked by the fact that the official documentation suggests creating custom AnimNotify blueprints that encapsulate the logic. That seemed a bit overkill for what I needed but this forwarding solution is just what I need. Thanks again.