HitBoxes and HitGroups

Concept

The HitBoxes are used to define if an attack touch the player or a NPC.

The code execute a TraceAttack() to define where the bullet or a “blugeon based”(melee weapons) weapon hits a special part of the body, of an NPC, to apply the Flinch Animations.

The “Death Activities” can be defined and properly selected by the code , when the npc is dying in different situation. It could depends of the hit groups that has been hitted, by the player or an enemy of the npc.

This is simple example for a cube model

 

Hitboxes creation

The best way to create the hitboxes, use the HLMV and go on the Bone Tab.

tutorial-hitboxes-hitgroups-hlmv

HitGroups

0 = HITGROUP_GENERIC

1 = HITGROUP_HEAD

2 = HITGROUP_CHEST

3 = HITGROUP_STOMACH

4 = HITGROUP_LEFTARM

5 = HITGROUP_RIGHTARM

6 = HITGROUP_LEFTLEG

7 = HITGROUP_RIGHTLEG

10 = HITGROUP_GEAR

Example :

The Result :

tutorial-hitboxes-hitgroups-npc-hlmv