- Home /
One particular particle. Off/on control?
Is there a way to turn a particle (ONE particle) that is emitted and turn it off (or do other things to it) without messing with the particle system. I don't want to enable/disable the game object that the system is attached to. And .stop() and .play() wont help with the already emitted particle. I want to stop one particular particle in it's tracks.
How?
thanks
Answer by tanoshimi · Jan 02, 2017 at 05:40 PM
No. A particle system is a system - a single entity. If you want to treat its particles as gameobjects that can be separately identified and rendered them you need to create them as such.
If I wanted to do that, I would've done that. I'm using the particle system for various reasons beyond the scope of this question. A particle is an object just like any other. There is obviously a way to access it and control its parameters. After all the Particle System creates and pools these particle objects at some point.
A single particle is not a gameobject. It has no transform component, which is the defining feature of gameobjects. And nor can it have components attached to it. It's basically just a quad in a dynamic mesh managed by the particle system of which it is part.
You are misunderstanding the difference between a GamObject and an object (lowercase). An object (in the traditional sense) is just an encapsulated collection of things (parameters, variables, classes, whatever).
A GameObject has a transform and I think inherits from monobehavior. A particle is some object that I have no idea what it is. I imagine it is some optimzed class that exist outside monobehavior and GameObject.
Clearly a particle is an object. I need to know how to access it. I don't what parameters it might have, but it probably does have the basic transform-y structs attached to it, pos, rotation, etc.
Either way, I don't care. I just want to access it and play around with it directly.
Exactly, I had to convince one of my project members of this. It is simply a SINGLE gameObject that has a lot of ability to act like multiple objects. However, you can run a "$$anonymous$$Ill" event in the particle to destroy individual particles... but if you put a collision trigger on the particles and ANY particle collides, it will run the event, if that event is Destroy(gameObject), every particle and the emitter will be destroyed.
Rob are you replying to me? How do you execute that "$$anonymous$$ill" event you spoke of. Sounds like exactly what I need to do.
Also for the record, my particles are not colliders. All I need to do is make the particle (a stretched billboard) disappear from the system.
Particles are automatically killed if they drop below the kill speed after a collision (docs). But that won't help you stop the particle or do other things with it - it just removes it from the particle system's array.
Answer by ifurkend · Jan 02, 2017 at 06:03 AM
I am not entirely sure what kind of result you want. But if you want to halt the movement of the emitted particles, you can give "ParticleSystem.MainModule.simulationSpeed" "zero" value which affects the whole particle system, not just ONE emitted particle.
I'm using particle system to simulate a bullet shot. I want the bullet to stop at time = t_impact, which may be different than time = t_travelLifeTime for example.
I am going to try particleSystem.Clear(). However that obviously clears all particles. I was wondering if there is a more definitive control over particular particles. Suppose I launch 3 particles and only 1 hits for example.
note: Assume I know (using raycast) which of the three is the hitting particle.
I personally wouldn't recommend using a particle as a projectile.. What you could do is create an empty object, treat that as the bullet and add a particle system to it? Or give it a sprite component that uses the texture from the particle system?
Best of luck!
That's what I'm doing. The particle is the bullet animation if you will that exist on the actual bullet object (which is static). One the bullet detects impact I want to stop the particle from continuing on its merry way.
Right now, I'm using .clear() and it works fine. However I'd rather have more individualized control ins$$anonymous$$d of over the entire particle list.
Your answer
Follow this Question
Related Questions
Did the behavior of gravity of particleSystem ever changed? 0 Answers
[Tank Game Tutorial] Particles Only Appear While Turning 2 Answers
Teleporting old particle system 0 Answers
Start/Stop a Particle System 2 Answers
ParticleSystem at Photon Not working! 2 Answers