# Best practice for detecting enemy death in 3D platformer

I'm building a 3D platformer, and I'm having issues figuring out how I should determine whether the player has effectively jumped on an enemy to kill them.

My current approach uses "hurtboxes" above the enemies like so:

And if the player has a negative velocity and isn't grounded while they collide with that hurtbox, it will kill the enemy. This works pretty well, but isn't ideal because the hurtbox being too big makes killing them easy, but making it too small results in unexpected failure to kill the enemy, which would be frustrating to a player.

Is this typically how 3D platformers deal with this issue, or are there better ways?

Thank you!

• This screenshot appears to be from the Unity engine, but you did not tag this question as Unity. Does that mean that you want a general answer which can be applied with any technology stack, or would a Unity-specific answer suffice? Oct 6 at 8:00
• What is it about using a large hurtbox that makes it too easy? Maybe there's an important game design decision that needs to be made that can keep the larger (more reliable) hitboxes. Oct 6 at 20:48

If you have a ground detection empty object parented to the player, you can use this,

Do A box cast from ground detection like this,

Collider enymyHitInfo  = Physics.BoxCast(origin , size , angle , direction);


and if the collider is true and the colliding object has "Enemy" tag then you can Destroy gameobject, like this ,

if(enymyHitInfo.collider != null)
{
if(enymyHitInfo.collider.gameObject.Comparetag("Enemy))
{
Destroy(enymyHitInfo.collider.gameObject);
}
}


This is all assuming this is C# and unity the same would apply to any other language but the syntax changes. That's all.