After doing some video tutorials on Youtube, I recognized that these two Classes look similar and repetitive.
-Collision2D-
This method called when an incoming collider makes contact with this object's collider (2D physics only)
void OnCollisionEnter2D(Collision2D coll) {
if (coll.gameObject.tag == "Enemy")
coll.gameObject.SendMessage("ApplyDamage", 10);
}
-Collider2D-
This method called when another collider makes contact with this object
void OnTriggerEnter2D(Collider2D other) {
Destroy (other.gameObject);
}
Both methods have same purpose and look the same. What is the difference?