title: How to destroy the whole prefab when the game object collides with the main character?
body: <p>What I'm trying to do is to make my monster disappear when my main char collides with it. So, I attached this script to my monster, but I can't get it to work. I succeeded in destroying monster's RigidBody component but I can't seem to destroy the whole thing. </p>
  
  <pre><code>using UnityEngine;
  using System.Collections;
  
  public class Dying: MonoBehaviour {
  private Rigidbody rbody;
  public GameObject prefab;
  
  
  void Start () {
      rbody = GetComponent&lt;Rigidbody&gt;();
  GameObject obj = Instantiate(prefab);
  
  }
  
  
  void Update () {
  
  
  } 
  void OnCollisionEnter(Collision col)
  { 
      print(col.collider.name);
      if(col.collider.name =="unitychan")
      {
           Destroy(prefab.gameObject);
  
      }
   }
  }
  </code></pre>