Question by
Anonymou5 · Oct 04, 2016 at 03:09 PM ·
collidertagontriggerstay
Can i tag collider?
Can i tag collider and use only that tagged collider in public void OnTriggerStay (Collider other)
If i can how i can do it?
Comment
Best Answer
Answer by SpaceManDan · Oct 04, 2016 at 03:27 PM
public void OnTriggerStay(Collider other)
{
if (other.transform.tag == "TagName")
{
Debug.Log("I was triggered by: " + other.transform.name);
}
}
Make sure before you do anything that you first set the tag of the gameobject in the inspector.