- Home /
How to make particles emit themselves facing the direction of the emitter?
When the particle quads come out of the emitter I want them to take their face/angle from the nature of the emitter, which is on an object in my scene that both moves and rotates. I can get the particle quads to emit from wherever the emitter is, but they will not cooperate with regards ONLY facing the direction they're coming off of the emitter at release. The emitter is attached to the object.
The quads either turn to face the camera, or, if using horizontal or vertical modes, they lay flat on that axis.
Is it possible to make them emit from the angle of the emitter, regardless of what that angle is? How?
there was an effort to answer this previously here. Where did it go?
Answer by Statement · Dec 23, 2010 at 07:48 PM
I am not entirely sure what you mean when you say you want particles to face the direction they are coming off from. Either you want what you say, and want the particle geometrical face to point in the same direction they are traveling in for some special purpose. I also guess you could mean that you want the particles stretched into the direction they are traveling (to make arcs etc). Third, your particles doesn't move in the general direction you were hoping for.
For the former behavior I have no answer for. I don't think you can control which directions the billboards should face in greater detail.
For the second you can check the settings on your particle renderer.
Distorting particles
By default particles are rendered billboarded. That is simple square sprites. This is good for smoke and explosions and most other particle effects.
Particles can be made to either stretch with the velocity. This is useful for sparks, lightning or laser beams. Length Scale and Velocity Scale affects how long the stretched particle will be.
There should be a checkbox named "Stretched", that allows particles to strech out in the direction they travel. You can also apply camera velocity scale to stretch the particles based on camera velocity. See also Length scale and Velocity scale that affect how the streched effect behave.
- If you are having problems with particles not emitting in the general direction you want, you are probably using world space settings instead of local space settings. These are configurable on your particle emitter.
Hey Statement, thanks for the effort and thought in your reply. Unfortunately you were right first time, I do want the particles to face the place of their origin rather than auto rotate to the camera or respond wonkily when their connection to world space is release. The unfortunate part is I think it's simply not possible in Unity's current implementation of Particles. I'll send you an email with a couple of example effects where you might see how it's beneficial to get control of a particles face direction.
Was a solution ever found for this problem? I have the same need, and I can't figure out how to get the particles to rotate to face their direction either.
Answer by Poemind · May 16, 2014 at 12:52 AM
I have the same issue. Basically I'm trying to create a star and would like the flames to emit from center but be rotated towards center. Seems like an obvious thing to me honestly.
Answer by Zacocast · Jul 15, 2015 at 09:02 PM
I had the same problem, but what I did was I created 10 different sprites as my particles, and equipped each of them with a script so every second one of the sprites would get teleported to the game object so it had the same rotation and position.
First I grouped all of my Trail Particle sprites and my Main Game Object together as children under one main parent.
Then I created a script that invokes a function to teleport each of the Trail Particles to the Main Game Object's position and rotation using two float variables; "base" and "timeBeforeTeleportation"
InvokeRepeating ("Trail", base , timeBeforeTeleportation);
I made it so "base" = "timeBeforeTeleportation" / numberOfTrailParticles * trailParticleNumber
function Trail () {
transform.position = mainGameObject.position;
transform.rotation = mainGameObject.rotation;
}
As you can see, the rest of my invoke statement is fairly simple. All it does is set each of the Trail Particles' Transforms to have the same position and rotation as the Main GameObject. Finally all I did was add an opacity argument so they would slowly become transparent and then reset it every time they got teleported. It helps blend them better.
I realize you posted this question all the way in 2010, but I figured there was still a possibility of me helping you. :)
Answer by pushxtonotdie · Nov 10, 2016 at 09:36 PM
Here is some example code on how to set the particle's orientation: https://gist.github.com/robotron2084/c09ca3b90a97cdbe2598728710fa2e99
Your answer
Follow this Question
Related Questions
Modifying particle renderer material and assigning new particle emmitter 1 Answer
How to make windswept snow on mountains? 0 Answers
How to pause emitter in new Particle System? 2 Answers
Accessing Particle emitter 0 Answers
ARK of the COVENANT | How do I trigger Particles to come out once the top has been removed? 0 Answers