- Home /
colliding with child trigger?
So at the moment I have a box that I want to do certain things when it enters different triggers. Right now when it enters a regular trigger it works fine, however it doesn't seem to be working for a separate child object. The code I am using right now is essentially:
OnTriggerEnter ()
{
if(collision.gameObject.tag == "Tag1")
{
print ("cleared1");
}
if(collision.gameObject.tag == "Tag2")
{
print ("cleared2");
}
}
Like I mentioned before, the first one works, the second one does not. Also, the tags are typed correct. is there specific thing I need to do to refer to the child or a work around?
Your answer
Follow this Question
Related Questions
Rotating cube (World) when player reaches edge. 0 Answers
Can Physics.IgnoreCollision disable OnTrigger... events? 2 Answers
Can not get OnTriggerEnter and OnCollisionEnter to work!? 1 Answer
How do I get my enemy to destroy my spaceship? 2 Answers
OnTriggerEnter being called event though there is no collision? 0 Answers