I have an actor who has some animations. Animations perform based on some actor states (animation blueprint of actor):
Conditions at the Event Tick (similar to while loop):
The actor changes perfectly from animation to animation. What I'd like to do is for it to damage an enemy as soon as the attack animation is over.
I tried some codes...
In this one, for example:
This variable (
minionAtk) modifies the state of the actor. See the image below in the event (which is only called when the
minionAtk is true) that I can successfully change the state of the actor (to the attacking state):
But since the change from true to false is done instantly, the attack animation is not even shown.
To solve this, I put a delay and a condition so that the event could not be called again while the execution of cycle (attack animation => end attack animation) ended:
So when the actor is in the attacking state, the attack animation usually performs. After 5 seconds the animation stops.
It turns out that in this time interval the animation does not play only once.
I imagine there is a way to do the time calculation that the animation lasts, and based on that set the delay time.
But better than that, I wondered if there was no way to know when the animation was finished and from that, change the variable to false and perform the damage action.
Thinking about it I researched and found this:
But I came across this error:
This blueprint (self) is not a BTTask_BlueprintBase, therefore ' Target ' must have a connection.
I also saw something about sphere traces, attached to an actor socket. But in my case I don't want to apply the damage just in case of contact of the actor's arm (armed or unarmed) to the target, it would be something as seen in MOBA style games.
It would be like a basic attack from Garen/Yasuo/Darius.