Home

Published

- 1 min read

unity c# on trigger enter with specific gameobject

img of unity c# on trigger enter with specific gameobject

The solution for this is noted below

unity c# on trigger enter with specific gameobject

Solution

   void OnTriggerEnter(Collider other)
    {
        if(other.gameObject.name == "Object name")
			//Object name is the name of the GameObject you want to check for collisions with.
        {
			//What you want to do on trigger enter
        }
    }

Try other methods by searching on the site. That is if this doesn’t work