- Home /
Can you make a particle emitter that emits inwards?
I'd like to make a particle emitter that will spawn particles at a given radius and have those particles travel in to the center. The effect should be that the particles are being sucked in to a central point, like you would see on a portal. I've been playing around with the particle emitters and I can't seem to find a good way to make this happen. Anyone know how?
Answer by Marnix · Apr 08, 2011 at 10:43 PM
Default particle emitters use only one emitter point. You want to use a complete sphere as emitter point. This is very well possible to create, but doing this in Unity will need some scripting. Maybe you could inherit from the ParticleEmitter
class?
There is also this piece of documentation about Ellipsoid Particle Emitters. But still, I think it will require some scripting, because not every particle emitted from the emitter has the same velocity. And also the force in the particle animator is different for each particle.
So concluding: It requires some inheritance or reuse of the ParticleEmitter and ParticleAnimator class. When a new particle has to be created:
- Determine the place on the sphere
- Determine the velocity (starting speed)
- Determine the force for this particle in the Animator
- Determine the energy for this particle (time until it will reach the end)
Alternative (easier?) solution
While creating this answer, I came at some other pages in unity as well.
- Create a Mesh Particle Emitter with a Sphere as mesh.
- Create a Particle Collider inside your vortex
- Let your particles die when they come into the particle collider.
The only thing is: what is the starting velocity? What is the force? So still, maybe some coding is needed to get this going in your way. Or check google for some unity particle effects. I'm pretty sure that someone has already done this.
Update
Come to think of it, the ellipsoid particle emitters have local velocity, so you could use that probably.
re: local velocity. That's with respect to the emitter's rotation, so good for ai$$anonymous$$g a spray, but doesn't consider particle spawn point.
Answer by Owen-Reynolds · Apr 08, 2011 at 11:34 PM
For a sphere, set minEmmiterRange to around 0.9 (90%) and TangentVelocity.Z to negative. Adjust Energy so they die before they cross the center and move outwards again.
Only works if the emitter is round (MinEmitterRange only properly sets them on the edge if XYZ are all the same.)
Tangent velocity clearly has something to do with "speed based on spawn position," but darned if I can figure it out.
Answer by Eric5h5 · Apr 08, 2011 at 10:47 PM
Use a mesh particle emitter and have the min/max normal velocities be negative. (Either that or have the surface normals of the mesh pointing inwards.)
Probably having an acceleration (negative?) would help the effect as things accelerate when falling inward
Answer by Bunny83 · Apr 09, 2011 at 03:17 AM
You can also use any kind of ParticleEmitter and use the .particles array to get the current particles and even changed them or add new particles. Just create a new array and write it back to .particles. Take a look at the Particle class which represents a single particle.
Your answer
Follow this Question
Related Questions
Particle emitter to emit "one-shot" on specific occasions 5 Answers
Particle Emitter Toggle ON/OFF 1 Answer
Particle emitter object destroys itself 2 Answers
Particle emitter works intermittently 0 Answers
Inverted Particle Emitter 0 Answers