I am trying to set up a framework to make fighting game characters. This would be for a 2.5D game using 3D models but with 2D gameplay.
So if I have an idle animation where every frame has associated hurtbox to match the character, and run / jump animations that also have every frame having character matching hurtboxes, is there a standard way to do hurtboxes during transitional animations, where I don’t really know the exact look of the characters model to match hurtboxes to it.
I’d like my character(s) to transition smoothly from action to action, which I believe is handled through blending, but I think this would mess with frame by frame hit/hurt boxes.
I know fighting games manage this somehow, but I can’t figure it out.
When making the actor blueprint then have the hands or feet be separate models or sprites and attach them to the base model or sprite. Then you can set the hot boxes for the hand and feet sprites (or whatever you want to do damage.) Once you do that then you can call custom events when on collision with said hands or feet sprites it can go to your damage system. I used this trick to make rotating enemies for a platformer when you only want parts of it to do damage. Of I didn’t answer your question right or you want screenshots I can give you those. Best of luck.
Set socket points midway between the bone locations.
Then calculate the hitbox extents, basically encapsulate the mesh area of your body section.
Finally do a, SweepSingleByChannel using a box shape that you created:
// Perform trace to retrieve hit info
FCollisionQueryParams TraceParams(MeleeFireTag, true, this);
TraceParams.bTraceAsyncScene = true;
TraceParams.bReturnPhysicalMaterial = true;
//Sweep a box that is matched to the claw
bool const bHit = GetWorld()->SweepSingleByChannel(Hit, StartTrace, EndTrace, Orientation, COLLISION_TRACE_WEAPON, FCollisionShape::MakeBox(BoxHalfSize), TraceParams);
You will need to store each location for each trace, then use that as start trace for the next trace for the next tick.
Thats a general way of doing and would be matched to the bones no matter the animation.
There are probably several other ways, but that one is easy to get going. Hope that help =)