public class PlayerCollision : MonoBehaviour {
void OnCollisionEnter2D (Collider2D coll) {
if(coll.gameObject.tag == "Player") {
Destroy(gameObject);
}
}
}
Try this. It's work defiantly..
↧