Answers for "destroy(collision.gameobject); in unity"

C#
16

destroy gameobject unity

Destroy(this.gameObject);
Posted by: Guest on March-16-2020
2

unity destroy object on collision

void OnCollisionEnter2D(Collision2D coll)
}
   // Check if we have collided with the enemy
   if (coll.gameObject.tag == "Enemy")
   {
      Destroy(coll.gameObject);     
   }
}
Posted by: Guest on March-06-2021

Code answers related to "destroy(collision.gameobject); in unity"

C# Answers by Framework

Browse Popular Code Answers by Language