I have been trying to figure this out for hours and I swear it should work but it just refuses to.
I have two 2D objects on the same layer at the same z position, both of which have 2D colliders and one of which (player) has a 2d rigidbody while the other is ticked as a trigger, with the following script:
void OnTriggerEnter2D(Collision2D col) {
if (col.gameObject.tag == "Player")
{
Print ("Collision!!!");
Destroy (col.gameObject);
}
}
However no matter which object I attach it to, where I put the function, what I try to change it to, nothing happens when they collide? The tag is definitely right and I have tried it without the if statement as well to see if it is working.
If anyone has any idea of what else it could be that would be amazing ![]()