I have an object with a mesh collider and a prefab with sphere collider. I want the instance of the prefab to be destroyed if the two collide.
I wrote the following in a script:
private void OnCollisionEnter(Collision c)
{
if (c == target)
Destroy(transform.gameObject);
print("something"); // Doesn't get printed
}
But it is not working. I have tried toggling isTrigger on both the objects.

target? I don't thinkc==targetwill ever betrue, but you should still get your message printed. You might be looking forc.gameObject == target. docs.unity3d.com/Documentation/ScriptReference/… - Tim S.