Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR CSHARP

Destroy Game Object

//Box collider is triggered
// Use "Destroy ( other.gameObject );" to destroy other game object
private void OnTriggerEnter ( Collider other )
    {
   //    if(other.tag == "Plane" ){
        Destroy ( this.gameObject );
   // }
    }
//Box collider is not triggered
//  private void OnCollisionEnter ( Collision collision )
//    {
//        Destroy ( gameObject );
//    }
 
PREVIOUS NEXT
Tagged: #Destroy #Game #Object
ADD COMMENT
Topic
Name
1+8 =