Registering Child collision in Prefabs

Hi Sorry if this has been posted before but I was unable to find a clear cut answer as to how this is achieved.

I have a zombie prefab which has destructible components ie… Head, Leg, Arm , Body

Now I can place Colliders on each body part but the parent Zombie has no collider or rigidbody.

And when I click on a zombie body part none of the colliders detect a collision?

This is a game similar to House of the Dead where you can “shoot” the zombie by clicking on them

So how do I register the Raycast hitting a body part when the colliders are children of the parent prefab??

I managed to find out what was happening…

The actual collider was being hit but the fact that the animated zombie walks the collider does not animate too so it ended up being behind the zombie prefab…

I suppose the next challenge is to find out how to link an animation with a collider so that the collider moves exactly the same as the prefab.

  1. Place a collider on the bone, not mesh.
  2. Do all your raycasts in LateUpdate instead of Update.

This is because animation update bones and does it inbetween Update and LateUpdate so in Update you can have all bones in default pose (T-pose) and in LateUpdate in animated pose to allow you make any kind of calculcations on this.

@palex-nx @Shabbalaka

I am having a similar issue.
I am trying to detect the collision between the different instances of child objects on a prefab. since the prefab is the same but differs by their instances I cannot have a different type of collider on the prefab. so I am limited to only 1 type of collisions (Rigidbody colliders) & 2 types of trigger handling (Rigidbody Trigger collider & kinematic Rigidbody trigger collider)

but none of them does my job. I have my script & rigidbody on the parent object and each child objects, whose collision i want to detect has a box collider. please help!!!