For detecting different body part shots on a zombie's body, is it better to use hurt boxes (hit box for some people), or physics materials?

Which method is more performant, or you can just state the pros and cons for each method.

  • Like place hurt boxes attached to the skeleton’s socket so move when animated, then line trace to detect if hit that hurt box which body part was hit?
  • or use the physics skeleton on some skeletons and apply certain physics material on that physics capsule around that specific body part, then line trace to hit that physics body part capsule and return which body part was hit

The reason I’m asking as it seems like the physics material is the best option as appears more performant as not calculate the hurt boxes all the time. But see many games and even AAA games use hurt boxes, so wondering why?

What do you mean by physics skeleton? Physics asset? A ragdoll? Those are not actually required to detect which bones get hit using line trace.

let me rephrase

was just following this video at this time stamp, and they use the physical capsule on the physics skeleton as the hitbox by applying physics material on it. So guess 2 for 1 deal as get both a physics capsule and hit box

While the other method was making an entirely separate hit box attached to the socket in additional to the already physics capsules

I guess the real question becomes if I want the hit box and physic capsule for ragdoll to be the same thing / same size. Was wondering if that would save performance?

I see you’re asking the most optimized way on detecting which bone of your character gets hit. Like I said before, neighter collision boxes nor a physics asset were required for line traces to return which bone they hit. Placing collision boxes on body parts is not obsolete though, they still got their purposes. About physics asset, you can still detect which bone gets hit by a line trace independently than the physics asset. All you need to do is breaking the hit result and returning the hit bone name. If the question is that “will detecting the individual body parts rather than a bigger volume covering them reduce performance”, the answer is no :innocent: because your character is already using it’s bones to animate. And line traces have absolutely no problem delivering your hit results. There’s really no extra services you’re activating during that process. Hope this clarifies your confusion :blush:

2 Likes

thanks for the response!

You need to have your trace or projectile ignore the capsule component. For this you can simply create a new collision obj channel.

Project settings → Engine → Collision

Create a collision obj channel for your projectile, or a trace channel for hitscan line tracing.

Update your character and NPC/AI characters to use the new Channel for the capsule component.

Ensure you IGNORE the Projectile (obj type) or HitScan (trace) channel.


Use whichever collision type/trace you setup for your weapons. For projectile set the Projectiles collision to custom, Projectile and ensure you Ignore Pawncapsule. Same if your using hitscan.

This ensures that the projectile/trace will hit the mesh and ignore the capsule.

You can then pull the Hit Bone from the result OR use the Physical Material to reduce switch options.


Physmat way simplifies dmg calculation + returns a surface type (flesh) for hit fx (audio && visual).
You’re only dealing with 8 possible hit localities vs the total num bones in skeleton (50+).

1 Like

Thanks for the detailed response!