I am making a campfire that plays a particle effect that looks like a a fire when the player walks up to it and hits the “E” key. My problem is that i want to make numerous campfires around the map using a prefab but when i do this the particle effect only works on one of my prefabs. Is there a way to make all of the prefabs work with the particle effect.
If you will use tagged prefab (for example “campFire”), you can stay that way:
if(Input.GetKey(KeyCode.E)){
GameObject[] campFires = GameObject.FindGameObjectsWithTag("campFire");
foreach(GameObject fire in campFires){
fire.particleEmitter.emit = true;
}
}
that will turn ON all your campfire particles in current scene.