How do I BPI pass a variable in Anim Notify to Char BP? [How to Hit trace in Anim Montage]

I take it you’re grabbing the bone name for traces and the reaction montage from a data table when you initiate the attack? If so, yea, you really only need one generic notify state. Also, don’t need to cast a message call.

That function could probably do the trace itself with the existing vars (assuming there’s no animation cancelling shenanigans), add all unique hit actors to an array, and immediately send them all a message to do a reaction function in a loop. Don’t need to cast or ignore anything here either, as only actors with the interface will get message. Could maybe optimize with a “does implement interface” branch though I guess.

If the trace function is only ever called by notifies, probably don’t need return pins on it, so just clear array and move on. Removing actors in a second layer might be freaking out since notify state is calling every tick?

The new reaction interface function would need the montage as an input (or use attack name if chars can have different reactions to lookup), and an actor pin for the instigator plus a float or something to do damage. If there’s no outputs on it, you can implement as an event and use timers or delays and a gate to add cooldowns as neeeded.

Cooldown or no, is probably better if the hit character is deciding to animate or not.

If character bp is getting bloated, could also move some of this to a new component class. Might come in handy one day if you want to punch actors not based on main character or its anim bp.

1 Like