- Home /
shooting and seeing through walls.
ok so im following the tornado twins tutorial (the worm game) and ive got to the part where they add the code to destroy the turrets. for one before the next bit of code and after it, you can see the fireballs through walls. now we have had to enable "is trigger" to get it to work, but now the fireballs go through walls (they hit the turret though). anyway please help
kris
(p.s. is there such thing as a unity city generator, i couldent help but notice from one of the tornado twins tutorials (25#)
Answer by john 2 · Aug 18, 2010 at 01:35 PM
well i followed that tutorial also. the "is trigger" button means the if it doesn't it something it's supposed to it goes through it (that's why it hits the turret) it is used so the fireballs don't pile up in your way in your game. so nothing is wrong. P.S. here's the turret collision script if you needed it:
var explosion : Transform;
function OnTriggerEnter( hit : Collider ) {
if(hit.gameObject.tag == "name of your fireball's tag")
{
Destroy(hit.gameObject);
var exp = Instantiate(explosion, gameObject.transform.position, Quaternion.identity);
Destroy(gameObject);
}
}
Your answer
Follow this Question
Related Questions
ned help with my carecter gliching 0 Answers
Missing Method Exception and Null Reference Exception 3 Answers
how to create Objectives 1 Answer
GAMEOVER SCRIPT for worm game 2 Answers
Turn colliders off in script 2 Answers