Call event from behaviour tree task to animation blueprint

I have one task that lets the enemy check if the player is in attack range. then a blackboard based condition, if it is true, the attack task starts.

Then the CharInRange event is called, setting the atacking variable to true in the animation blueprint so the state machine can use it.

How do I connect with the object pin? Or is there are a better alternative?