how to check the tag in a collision unity code example
Example: how to do collision tag in unity
void OnColliSionEnter2D(Collision col){
if (col.gameobject.tag == "Enemy"){
Destroy(gameObject)
}
}
void OnColliSionEnter2D(Collision col){
if (col.gameobject.tag == "Enemy"){
Destroy(gameObject)
}
}