Answers for "refrerencing tags unity"

C#
0

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");
        }
    }
}
Posted by: Guest on December-15-2020

C# Answers by Framework

Browse Popular Code Answers by Language