OnCollisionEnter Function from 3rd party Object?

Hi all.

Ok here is the scenario. Lets say I have 3 Objects in my scene, A B and C.

For what ever reason I want to ask Object A to detect a collision between object B and C without putting script on object B or C.

So if I place:

function OnCollisionEnter(collision : Collision) {



on Object A, it would of-cause print the tag of what ever object A collided with. But I want to keep the script on Object A and I want it not to detect the A collider but the collider on Object B to see if it hits C.

Any ideas?

It's not possible, sorry.

I personally would use a "game manager" script to achieve such a thing( or singleton, etc).

By this i mean a persistent script on an empty that can check for, and/or be sent variable registered in objects within the scene.

So, object B could send a variable to the game manager when object C collides with it, or the game manager would be listening for a variable change on object B due to the collision triggering it. And then, at your discretion, the game manager could send that changed variable to object A, or object A could be listening for the variable change in the game manager script.

If you aren't familiar with game managers, IMO, they're invaluable for communicating data to and from scene objects behind the scenes , and throughout all of the actual scenes in your app/game, staying active even when new scenes are loaded.