- Home /
Rigidbody will overwrite children colliders, and collision events won't run.
So... I have an entity, and it has 6 hitboxes (cube-collider, is not trigger and children of entity) what detects the gun bullets. It works fine but I want to add to my entity Rigidbody. And if I make this, the hitboxes won't detect the collision and the bullets glance off from the hitbox.
So you have colliders on the childs of the rigidbody? Where do you do your collision-handling? so where do you execute Code on Collision with OnCollisionEnter()? On the Projectile? Or on the transform that has the Box/Cube-Collider attached?
Yes, the child hitboxes has the collider and I want to add to my parent a rigidbody. The collision event handler is the hitbox, because they don't have rigidbody but the bullets has. (If the event handler is the bullet, it won't work)
Answer by erik0304 · May 11, 2018 at 11:30 AM
I found the solution: Switch true, the Rigidbody.detectCollisions to true. For Example:
public void Something()
{
GetComponent<Rigidbody>().detectCollisions = true;
}
Your answer
![](https://koobas.hobune.stream/wayback/20220612162413im_/https://answers.unity.com/themes/thub/images/avi.jpg)