I have two different objects I would like to check when A and B gameObjects are collided ?

Hi all,

How can I get solve the next problem ? :slight_smile:

I have two different objects for example “Object A” and “Object B” and I have another gameObject which ones take a Script (calls: GameEngineHandler). So I would like to check when “A” and “B” gameObjects are collided, how can I get this information from another gameObject which keep the script ?? :slight_smile:

Thank for the help in advance!

Here is a code snipp:

         public void OnTriggerEnter(Collider col) {
             if (player.GetComponent<Collider>() == colliderbox.GetComponent<Collider>()){
                 Debug.Log("Player and the box are collided !");
             }
         }

Object C cannot tell whether Object A and Object B collided. Collision messages are sent only to the colliders/rigidbodies involved in the collision itself.

If you want to create a collision manager you can do so, but it will need to be updated by messages sent from the OnCollisionEnter callbacks of the colliding objects themselves.