refrerencing tags unity code example
Example: refrerencing tags unity
using UnityEngine;
public class Example : MonoBehaviour
{
public void OnCollisionEnter(Collision c)
{
if (c.gameObject.tag == "Bad Guy")
{
Debug.Log("Collided with bad guy");
}
}
}