- Home /
Unity 4.3 Shuriken Particles attached to Sprite
How do I add more than 1 shuriken particle system to a sprite game object (to create an effect)? If I attempt to add more I receive an error from the inspector. I want to add several particle systems to create an effect like when nesting them to parents when not attached as a component to other game objects. Thank you
What does "an effect like when nesting them to parents when not attached as a component to their game objects." mean?
Does this mean you tried setting up several gameObjects with particleSystems as child/parent, but it didn't work? That's the usual way. What was wrong with it?
Thanks and I am sorry, I nest particle systems in particle systems than add to scene and the "particle effect" is created with all systems emitting. I can add a particle system through the inspector to a sprite game object and then access the system in code. I can not or do not know how to add more than one particle system nested or otherwise to the sprite via the inspector. Is this possible and if it is not possible how would I go about coding so I can access all the systems? Hope it is a little more clearer
Answer by Owen-Reynolds · Jun 26, 2014 at 02:09 PM
In general, Unity is set up so that each type of component goes on a gameObject once. If you want more of a component, make another gameObject with it and make that gameObject a child of the other one. To find the other component, use the standard "finding a child" method.
If you have several "equal" components, have the parent not have one at all, and then have each child gameObject have one of them. That can make coding easier (for example, a single foreach can handle them all.) You are allowed to have them all nested -- grandchildren and so on. But there isn't much reason. Easier to have all be direct children of the main parent.
As to why, if a single gameObject had two renderers, or particleSystems, then g.renderer
wouldn't know which one you were talking about. Plus, say you want two particleSystems aimed in a little different direction. If both are components on the same gameObject, you can't do that.
Of course, if this is something specific to particle systems (subParticles,) or Sprites (not sure what that trick would be,) the answer may be different.
Thank you for the excellent explanation. I did as mentioned. I just nested the particles as separate "equal" particle system game objects with the sprite game object as parent. I can then tag them and through script component access I select the particle systems as needed based on the tag. These particle systems than create the particle effect I need. Thanks again
Your answer
![](https://koobas.hobune.stream/wayback/20220613152448im_/https://answers.unity.com/themes/thub/images/avi.jpg)