- Home /
All instances of particle emitter prefab are emitting when emit=true
I'm not quite sure why I'm having this problem, I've created a particle effect which I saved as a prefab, then instantiated and set emit=false.
When needed, I set emit=true on the emitter attached to the gameobject and ALL the instance of the emitter attached to other objects begin to emit as well.
Declarations:
public ParticleEmitter explosions;
ParticleEmitter combatMarker;
Instantiation:
combatMarker = (ParticleEmitter)Instantiate(explosions, transform.position, transform.rotation);
combatMarker.emit = false;
combatMarker.transform.parent = this.gameObject.transform;
combatMarker.name = this.gameObject.name + " combatMarker";
Emit checks and assignment
if (localFleets.Count > 1)
{
if (isFighting)
{
Fleet.Battle(localFleets);
combatMarker.emit = false;
isFighting = false;
}
else
{
combatMarker.emit = true;
isFighting = true;
}
}
This is beyond frustrating...I've done scripts that use particles as projectiles without issue, but this is giving me an all-star headache. Any insight is appreciated.
Has anyone else had something similar to this happen? I'd love to know how you fixed it.
Thanks in advance.
Your answer
Follow this Question
Related Questions
Distribute terrain in zones 3 Answers
turning on a particle with an input key 0 Answers
Multiple Cars not working 1 Answer
ID or name for Instantiate prefab 1 Answer
How can I emit animated prefabs from a particle system? 0 Answers