- Home /
Is it possible to grab the emitted particles from particle system and attach a component to them?
Title says it all.
Answer by MrSoad · Oct 16, 2014 at 11:56 AM
I've not done this. If you made your own particle emitter using object pooling and prefabs(a particle prefab, instantiated for as many as you need and stored in an array) then you can should be able to attach components to these(loop through you particle array) at run time if needed.
I'm asking about how to do this with Unity's new particle system, Shuriken.
I'm talking about building your own one from scratch, this way you can do whatever you like with it. I have no idea how or if you can do it with the Shuriken particle system, but I have built my own using the method descried above. Using the term particle above may have been a little misleading for which I am sorry.
Have you Googled "Unity add component to shuriken particle system" to see what info is already out there regarding the possibility of using it in the way that you wish to?
Answer by Kiwasi · Oct 19, 2014 at 11:01 AM
You can grab the particles from a particle system. Then you create a GameObject and set the transform position to match the particle position. You can have any components you want.
I've not tried this, so I can't say how performant it will be.
This approach won't work for two reasons:
1) I want my game objects to move with the particles, for example when I emit blood particles, I want my box collider 2D to move with the particle every frame.
2) I need to move the particle in accordance to bounce movements that the collider will receive based on it's collision to other objects it will collide with.
To make the GameObject move with the particles you will want to grab the position of the particle every frame and reset the position of the GameObject. Or you can do it the other way and set the particle position by the GameObject. It makes no sense to do both.
Ultimately you might be better off abandoning particle effects and just using plain GameObjects. Particle effects are designed for the cheap production and movement of a lot of small sprites. What you are describing is no longer cheap.
Your answer
![](https://koobas.hobune.stream/wayback/20220613165224im_/https://answers.unity.com/themes/thub/images/avi.jpg)
Follow this Question
Related Questions
Emitting Particles on Collision 0 Answers
Emit Particle when the parent gets collision 2 Answers
How to access particle collision locations 2 Answers
Locking particle axis? 3 Answers
Anyone had this collision glitch? 0 Answers