- Home /
Question by
boko52 · Dec 07, 2012 at 07:01 PM ·
collisionfunctiontriggersprojectile
Problem with Projectile triggering script to destroy door
Hey guys im currently trying to set something up for my level where to proceed through the level, the player picks up a blue projectile pickup. they then need to throw the blue projectile at the blue door to destroy it.
I tried to use Function Trigger on Enter but this didn't work as making the door a trigger would allow the player to run straight through it.
The latest thing I tried was this:
function OnCollisionEnter(other : Collision)
{
if (other.tag == "bluewall")
{
Destroy(other.gameObject);
}
}
But this also seems to not work. The code is currently attatched to the projectile and looks for the tag "bluewall" which is tagged on the wall.
Any ideas on how to get this working? Any help is much appreciated.
Comment
Your answer
![](https://koobas.hobune.stream/wayback/20220613085118im_/https://answers.unity.com/themes/thub/images/avi.jpg)