Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR CSHARP

unity c# on trigger enter with specific gameobject

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
        }
    }
 
PREVIOUS NEXT
Tagged: #unity #trigger #enter #specific #gameobject
ADD COMMENT
Topic
Name
1+8 =