4
\$\begingroup\$

The question really sums it up: What is the best way to use one particle system for playing different particle effects?

The scenario: GameObject is picked up and it starts playing a simple indicator particle effect. If the GameObject is placed on a special platform it will play another particle effect.

I have very little experience with particle systems - how would you do this?

\$\endgroup\$
4
\$\begingroup\$

Attach two GameObjects to one parent, each with a ParticleSystem, and just activate/deactivate them as needed.

\$\endgroup\$
  • \$\begingroup\$ Aye, this is how I have done it at the moment. Each particle effect is a prefab which is then attached to a parent. But is it possible to use just one ParticleSystem and use it for all effects? Instead of having all the possible effects as separate prefabs, it would be a lot more neat to load the wanted effect on a single ParticleSystem. \$\endgroup\$ – Esa Apr 30 '13 at 10:58
  • 1
    \$\begingroup\$ Well, no, not in a neat way. I guess you could somehow save all parameters of a given PArticleSystem to a file, and then load them and change everything in runtime, but that seems pretty pointless. Activating/deactivating different objects is actually a pattern that is commonly used in Unity, not just with effects but with many other things. \$\endgroup\$ – Nevermind Apr 30 '13 at 12:23
1
\$\begingroup\$

It depends on a situation. If you have only two different particle systems that you want to use, Nevermind's answer with two different child object is definetly the best. However, if you want to use a lot of different particle systems (for example, if you making an RPG with a lot of spell effects), you may want to instantiate/destroy (or better, take from object pool and put back there) particular particle systems each time for each such event.

\$\endgroup\$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.