void OnCollisionEnter2d(Collision2D col) {
Debug.Log (col.gameObject.tag);
if (col.gameObject.tag == "Battery(Clon)" ||col.gameObject.tag == "Battery" ) {
//score.score += 100
Destroy(col.gameObject);
battery_count ++;
}
else if (col.gameObject.tag == "shield(Clon)" || col.gameObject.tag == "shield") {
Destroy(col.gameObject);
shield_count ++;
}
}
i have this code and for some reason when my player collides with the shield or battery nothing happens, all 3 objects have a rigit body and colliders
those are the two inspectors of my battery object and my player object which is the one has the function above, the batter tag is Battery. i dont know why is not going into the method