I recently started to play around with emitters to create atmospheric effects, such as falling snow or floating bubble across the entire planet/scene. I have noticed that this is EXTREMELY taxing having 60+ emitters spawning over 400 particles every 5 seconds to create the effect I am looking for. So what I have done is put a collider with trigger set to active around each emitter, and am toggling off the emitters stop and play functions as the player enters and leaves the collider/emitter range. The problem I am having is that I am unable to stop, or even disable (via gameobject) the emitters directly after the scene loads. I have tried using the Start(), OnLevelWasLoaded(), and even the Awake() functions. Here is the script I am currently using:
void Start()
{
this.GetComponentInChildren ().Stop();
}
void OnTriggerEnter() {
this.GetComponentInChildren ().Play();
}
void OnTriggerExit()
{
this.GetComponentInChildren ().Stop();
}
The code above is designed to be attached to a parent object, with two children. Each child has it's own emitter, each with a different spawn size and particle texture. Any ideas on how to get the emitters to stop playing after they load?
I am also open to other suggestions on how to reduce the load using emitters on this scale.
Trending Articles
More Pages to Explore .....