So I pulled “Flame” out of the Standard Assets and stuck it on my Car object.
Then I dropped this script into the assets folder:
var emitter : ParticleEmitter = GetComponentsInChildren(ParticleEmitter);
if (Input.GetButton("Fire1")){ emitter.emit=true;
}
else{
emitter.emit=false;
}
And promptly got this error:
Assets/fire.js(1,56):BCE0022: Cannot convert ‘Unity Engine.Component’ to ‘UnityEngine.ParticleEmitter’.
I’m trying to make it so I can control the fire by clicking. What am I doing wrong?