Way to Make Multiple Colliders act like Single Collider

There are several enemies in the game I’m making with fairly complicated geometry. Since I’m using mesh colliders (made using meshes imported from Blender), I’ve had to make them convex for rigidbodies to handle them - which means that I’ve had to add a bunch of collider-meshes as children of each enemy in order to handle their collision geometry.

This has worked fine for rigidbody work - but it runs in to problems when I start throwing around AoE attacks. A hit to any of the colliders has to register damage, so all of them will register an attack and pass the damage dealt to the central damage-handling script. However, this means that if the AoE (using a SphereCast) hits multiple colliders, all of them register damage. This is a problem, since I want the enemy to only take damage once.

It seems like a solution to my problem would be either to find a way to get all these colliders to behave like they’re the same collider, or to find a way to make a complex mesh collider that can have concave geometry while still working with rigidbodies. Any help on either of these routes would be appreciated.

You need to be more robust in your handling of damage registration. If damaged, record that somehow (eg add the damager to a list of objects that have damaged the character during this frame) in the central damage-handling script, and just reset that record at the start of each frame.

To ensure the record gets reset before trying to do damage in the next frame, you’ll need to set your central damage-handling script to be earlier in execution order than the child rigidbody’s script, and perform the reset at the start of Update() (or whatever update method you’re using).