Catch Animation Event from Animation BP in C++
Here is the scenario when I got this issue:
I'm currently implementing the attack animation and hit detection for enemy actors.
At the end of an attack ends, the enemy have to do two things:
1.Set attack animation to unplayable, which can easily done in the animation BP.
2.Clean some of the member variable value in enemy class, which can be done, in my thought, in 2 ways:
I think that the second solution is better, since I can keep it from messing animation BP graph, and keep the function call in C++ class. The question is, I have no idea how to do it. If anyone knows how to do it, or even have a better solution for it, I will appreciate your help.
asked Jul 11 '15 at 02:23 PM in C++ Programming
Got the answer by myself anyway. Here's the solution:
for( TArray::TIterator it =
GetMesh()->AnimScriptInstance->AnimNotifies.CreateIterator(); it; ++it )
you can use the NofifyName attribute to do the necessary operation you want.
answered Sep 28 '15 at 09:26 AM
For fature referance if anyone would need it. I do it right now this way:
Crating a BP variable to get the notify from animation.
Create "new notify" with whatever name.
In Animation BP in event graph get the enemy and set created earlier variable to some value on notify- event name.
In Tick function check variable and do some stuff
Follow this question
Once you sign in you will be able to subscribe for any updates here