I made a flame thrower and had the small flames attach to it but when I stop the flames the prefab disappears.
Here is the code:
var flames : ParticleEmitter;
var gunSound : AudioSource;
function Update () {
if (Input.GetButtonDown("Fire1"))
{
flames.emit = true;
gunSound.Play();
}
if (Input.GetButtonUp("Fire1"))
{
flames.emit = false;
}
}
function Start () {
Screen.lockCursor = true;
}