I'm trying to figure out the best way to create mugen like hitboxes on a game character attack animation, like chun-li's kicks. Does anyone have an idea how to do this? THe example project is a gun game. Also, the sprite I'm using is one sprite, no separate parts. So I can't attach a collider easily.
I don't know for real, but maybe you could instantiate a game object with a hit box attached to it when the attack animation is run? There's the new Animation Event system (which I haven't used yet), and perhaps at the right point in the animation the box can be created for hit detection.
My suggestion would be to create a few colliders for your character. Circle colliders for the hands, feet and head, a few box colliders for the body, arms and legs, each contained in a child object of the main character with the IsTrigger checkbox set (though with unset you can have them be used in affecting the physics positions of other objects). This image shows the object hierarchy with all of the subobject's colliders displayed. Note that the Sprite Renderer component belongs to the main Fighter object. This images shows one of the single body piece objects, with the Circle Collider 2D component on it. With a setup like this, you could then create animations for the Fighter object that affect it's sprite and all of the subobject transforms. Add a script to control the character, and an enemy with a similar setup that has a script that reacts to physics2D collisions and you should have the basic setup for a fighting game. Hope it helps, - Wynter Woods