I have a Meteor and a Player object. Both with RigidBody2d and Colliders2d. Meteor collider has "Is Trigger" checked and it has a script with OnCollisionEnter2D() implemented but the collision is not working when the meteor hits player:
private void OnCollisionEnter2D(Collision2D other) {
Debug.Log(other.gameObject.tag);
Destroy(other.gameObject);
}
}
-Meteor-
-Player-
View
OnCollisionEnter2D
is called when the object collides with another solid object, and because the meteor is a trigger, it'll never be called.
Try using OnTriggerEnter2D
instead.