void OnCollisionEnter2D(Collision2D col) { if (col.gameObject.tag == "enemyCar") { Destroy(gameObject); } ui.gameover(); }
void OnCollisionEnter2D(Collision2D collide)//Once a collision occurs destroy the car object { if (collide.gameObject.tag == "Enemy car") { gameObject.SetActive(false); ui.gameover(); } }