Child collider trigger problem

Hey :slight_smile:

I have a little problem with 2 objects. I have 2 boxes, there has a parent with rigidbody(No gravity, and non-kinematic), a mesh and a script to debug the trigger, and a child with a collider, where IsTrigger is set to true.
But then i to box collide is only the one of the box there get a message.

The script:

public GameObject Hitting;	
void OnTriggerEnter(Collider collisionObject)
{
	Hitting = collisionObject.gameObject;
	Debug.Log("T: "+this.name+" was hitted by: "+collisionObject.gameObject.name);
}

If i move the collider to the parent i works.

Any solution for this?


Mathias

I’m not entirely sure I understand your question.

I think you’re saying that one object has a RigidBody, and one has a Collider. I believe that only the RigidBody would be notified of the collision. If there’s a parent/child relationship, you could manually call a method on the other object to inform it of the collision. Or make them both RigidBody.

The 2 boxes are identical, and look like this:
(http://img837.imageshack.us/img837/6055/unityproblem.png)

It works if the collider i both boxes is in the parent


Mathias

No one, there can help? :slight_smile: