I dont know if its because I use sprites, I want to make a prefab destroy itself when colliding with a sprite with tag “Barrier”, they have Rigidbody2Ds, Box Collider 2Ds (with IsTrigger true) , same Z and they still dont collide. Can anybody identify what’s wrong?
public class ShootScript : MonoBehaviour
{
void OnCollisionEnter2D(Collision2D coll)
{
if (coll.gameObject.tag == "Barrier")
{
Destroy(gameObject);
}
}
}