Child Object OnCollisionEnter Effecting it's Parent + Sibling Objects

Hey guys thanks for reading.

I have a wall, the wall is made up of bricks. All these bricks are stored in a “Wall” empty gameObject . When my bullet hit’s a brick, I would like only the brick it collided with to be setActive(false); however for some reason the parent of this object is also being setActive(false); along with all other brick sibling objects.

This does not happen when it is not a child of the “Wall” gameObject, but it is not possible for me to not have this parent, for other reasons in the game.

I have tried using:

 void OnCollisionEnter(Collision other){
                other.gameObject.transform.parent = null;  
      }

but this also did not work. I am COMPLETELY stumped :(. Any ideas?
Here is my code.

 void OnCollisionEnter(Collision other){

	
	if(other.collider.transform.tag == "Cube"){
		

		other.gameObject.SetActive(false);
		
	}
	
}

do those bricks have rigidbodies?

also maybe try:

other.collider.gameObject.SetActive(false);

untested, but that code should access the gameobject with the collider because just gameobject is likely too vague and thats why you get the parent because technically it is the gameobject you’re hitting

Hi, are the wall components (bricks) named “Cube”? If yes, then look for a chain reaction between bricks. I am just guessing. You will see, if you insert debug output into CollisionEnter callback.