unity if collide with tag code example
Example: how to check the tag of a collider in unity
void OnTriggerEnter(Collider collision)
{
if(collision.gameObject.tag == "[Tag]")
{
//Do Something...
}
}
void OnTriggerEnter(Collider collision)
{
if(collision.gameObject.tag == "[Tag]")
{
//Do Something...
}
}