Check a collision between 2 gameobject with another gameobj

What do I want to do?
The script below is attached to a gameobject called MainCamera
I want to check if there is a collision between 3 objects :
a gameobject that contains a script called “WhiteChecker”
a gameobject called path1 or path2.

This script is working when I attach it to path1 path2. but this script is NOT working obviously, when I attach it to MainCamera.
How can I edit my script so what I asked above will work?

	void OnCollisionEnter(Collision Other)
	{
		if ( Other.gameObject.GetComponent( typeof(WhiteChecker) ) != null)
		{
		renderer.enabled = false;
		}
		}
		void OnCollisionExit(){
			renderer.enabled = true;
		}

Probably the easiest way would have the collision script pass a state to another script attached to the camera.

Your Camera would have a state machine script where if varX = true, then render.enabled = true, else render.enabled = false.

Then, all you do in the collision script is turn varX either true or false, as you need. Leave it attached to the path objects, and everything should work fine.