Im newbie so im trying to make a color switch game to hone my skill but im having a hard time on how to get a collision with same color so I decided on comparing 2 tag so if they are the same tag I will disable the collision
private void OnTriggerEnter2D(Collider2D collision)
{
if (collision.tag == "ChangeColor")
{
Destroy(gameObject);
Destroy(collision.gameObject);
Instantiate(Players[Random.Range(0, Players.Length)], transform.position, Quaternion.identity);
}
if (collision.tag == gameObject.tag)
{
Debug.Log("does it work this way??");
}
}