- Home /
Particle Emitter starts when I have an object
I'm making the surviving island game and I have a problem. I'm on the last part, when I get the matches I want to go to the campfire and then if I walk there the fire begans, but I don't know why the particle system doesn't starts when I walk there.
Someone Help me please it's very important!
Thanks
The code:
#pragma strict
private var fireIsLit : boolean = false;
function OnControllerColliderHit(col : ControllerColliderHit){
if(col.gameObject.name == "campfire"){
LightFire(col.gameObject);
}
}
function LightFire(campfire : GameObject){
var fireEmitters : ParticleEmitter[];
fireEmitters = campfire.GetComponentsInChildren(ParticleEmitter);
for(var emitter : ParticleEmitter in fireEmitters){
emitter.emit = true;
fireIsLit=true;
campfire.audio.Play();
}
}
function Start () {
}
function Update () {
}
Comment
Answer by bruga94 · Jan 03, 2013 at 10:54 PM
If I touch the collider that is in a object and there's a particle emitter in it.