- Home /
Question by
user-3061 (yahoo) · Jul 04, 2010 at 10:36 AM ·
projectileweaponrocketlens-flare
Lens flare as missile, make it dissapear?
Ok, heres the question. I have assigned a lens flare to my rocket, which is shot by a rocket launcher. After the rocket colledes, the lens flare seems o be stuck there forever. How do i make it dissapear after some time?
Comment
put Destroy(gameObject,2); in the lens flare script to remove the game object after 2 seconds
How do i put it in? Theres no script for lens flares... can you give me the full script, thanks?
Best Answer
Answer by YeOldeSnake 1 · Jan 06, 2011 at 06:48 PM
var lensFlareBehaviour:Behaviour;
function MissileExplode(){ //code for missile and stuff Destroy(lensFlareBehaviour);//destroy the lens flare Destroy(gameObject);//destroy the missile
}
Just assign the lens flare behaviour to the lensFlareBehaviour variable through the inspector view