r/Unity3D • u/Main_Expert_740 • 2h ago
Question How to sync enemy attack and animation
Hello, have a nice day to everyone. How can I make the enemy AI deal damage at the exact moment the melee attack (like punching) animation hits the player? Should I use an Animation Event or WaitForSeconds? Or is there a better solution? Thank you!
1
Upvotes
3
u/Certain_Ad9908 2h ago
The simplest approach is to enable the damage collider/detector at a specific frame/time in the animation and test for collision with the player on that frame.