Sync animation with the attack

How can I sync the melee attack animation of my player when it is about to hit the enemy? So that the TakeDamage function is synchronized as well.

You can use animation events, though the hows of using them depend on if you’re using legacy or mecanim.

And of course, just using timeouts with WaitForSeconds always works in a coroutine.

Thanks! I’ll try to use the animation events. What’s the difference using legacy and mecanim animation type?

They’re just fundamentally different systems, so they are different in how you set everything up.