How can I rotate a particle effect?
I'm building a project based on the space shooter tutorial. In part three of the tutorial (about 8 minutes in to the video), we use a particle system to add an engine flare effect. The problem I'm trying to solve is that when I rotate the ship, I cannot get the engine flare to rotate with it. Even changing the Transform of the game objects doesn't seem to affect this. you can see the problem in my screen cap. The engine flare is pointing straight up and down despite the rotation of the Player game object. How can I rotate this particle effect?
(Shuriken) Look at the component itself in the editor. You will see a sub-section for this.
Necro-ing and ancient thread here, but I'm working with the space shooter tutorial in Unity 5 and am running into the same issue.
The thruster particles are children to the ship, and their position rotated relative to the ship is correct. However the rotation of the particles about their own origin does not change when the ship's rotation changes. They always face at 180 degrees.
I tried changing to world, but that doesn't solve it. Any ideas?
Here's a screenshot for reference... Appears to be the same issue as posted above.
The "answer" (which is wrong) is a bit silly since $$anonymous$$eat5's 1st comment is pretty much correct. If you're using particle systems, you first should go through all the settings, to $$anonymous$$ch yourself. It's like reading the manual.
One of them changes the "facing" of the billboards (it's in Renderer.) But, esp. for rocket jets, there are a bunch more settings that should be adjusted, which are obvious after you're experimented with them once.
Answer by Stamblew · Nov 23, 2018 at 09:08 PM
I know this question is old, but for those who are still looking for a solution, what you can do is:
Go to your particle Renderer module
Change the Render Mode option to Billboard
Change the Render Alignment option to Local
Now you can rotate your particles using the transform of the object.
PS.: I tested this on Unity 2018.1
This works great. If you're actually using the space tutorial jet asset, don't forget to rotate the particle system by 90 degrees in the x direction to get it right.
Answer by harrisjed · Oct 26, 2015 at 11:56 AM
I faced the same problem while working with the Space Tutorial. What worked for me is setting for both part_jet_flare and part_jet_core particle systems the start rotation in FixedUpdate() to be the same as the player object - i used two player objects with the second one to be inverted and I instantiated them in the game controller script.
pSys.startRotation = gameObject.transform.rotation.eulerAngles.y * Mathf.Deg2Rad;
Also check this answer too.
This solution worked for me. I attached the part_jet_flare to public GameObject thrust_flare;
.
Then in FixedUpdate()
I added:
thrust_flare.particleSystem.startRotation = gameObject.transform.rotation.eulerAngles.y * $$anonymous$$athf.Deg2Rad;
I note this because pSys.startRotation
doesn't clarify that it's the particleSystem
object type ins$$anonymous$$d of the GameObject
type.
Thanks a lot! In my use case I just needed to switch to pSys.startRotationY everytime I called play on my non-looping particle system.
Answer by Owen-Reynolds · Aug 03, 2014 at 04:21 PM
Are we only giving hints now? Fine with me: (partial spoiler):
Like many other things, particles can use xyz world space, which means they ignore facing and always use x=right ... . This is good for a rolling, flaming log, where you always want +y to be up, for rising flame and smoke.
Or they can use localSpace, which means they use the xyz of their transform.
The setting has sort of an odd name, but it uses the words "space", "local" and "global."
(spoiler alert) For Lady Stark there's dead, and there's dead.
also:
Simulation Space
[edit] Whoops! My answer is completely wrong. I was getting mixed up with the older particle system.
Depending on which shape you select, the particles should always fire the way the transform is pointing. Sphere is always 360, hemisphere is always within 90 degrees of forwards, cone always aims the way the transform goes.
It's very difficult to make a particleSystem that doesn't spin when you do (except for a sphere, for obvious reasons.)
SimulationSpace is merely whether old particles track your motion.
Now, down in ForceOverLifeTime and VelocityOverLifetime, the settings for Local/Global really do pick which coord system to use. But not many people use those. For example, "thruster flames" are easy to make with a tight cone and sizeOverTime.
Beauty, thanks for the (cryptic) answer, I'll try that this evening. Also thanks for the extra context you provided, that's a big help for my understanding of how the particle system works.
Hmmm there's a property called "Simulation Space" but it doesn't seem to change anything. The rotation of the graphic doesn't change.
Answer by animator_84 · Jun 02, 2015 at 11:06 AM
use a quad/plane as under Render/ Rendermode/ Mesh. Then choose your particle material. Then You'll be able to rotate your particle in 3d space.
The question is sort of poorly worded. I think http://answers.unity3d.com/questions/219565/how-to-orient-particles-to-direction-they-are-movi.html is what the original poster meant to ask, and has what I think is the correct answer.
animator84: If you leave the default PE, rotation isn't an issue, since it's round. Anyone having this problem has already selected a different material (like the spaceship flames.)
This solution works.
If you're using the Space Shooter build, under the Particle System for the part_jet_flare and part_jet_core, look under Renderer and the first item is Render $$anonymous$$ode. Change it from Billboard to $$anonymous$$esh (and use the circle select tool to pick Plane - the default of Cube looks semi-decent because it's a glowing line co$$anonymous$$g from the back of your ship, but if you look closely you see it's doing this because it's projecting the effect both forward and backwards). You'll want to resize the elements - this can be done under Start Size, which is not in the Renderer section but above in the element's basic settings. I set $$anonymous$$e to .1 / .08 for the flare, and .1 / .2 for the core.
As animator_84 said, the mesh will then turn with you.
Just another little addition here to $$anonymous$$arishi's answer - when scaling, make sure to change Scaling $$anonymous$$ode for the Particle System itself from 'shape' to 'hierarchy'.
Answer by kaleidosgu · Nov 21, 2017 at 11:00 AM
Thanks for all the answers. I update one solution.
Vector3 vecDir = vecPosEnd - vecPosStart;
ParticleSystem.MainModule mainMod = yourParticleSys.mainMod;
mainMod.startRotation = Mathf.Atan2(-vecDir.y, vecDir.x) ;
Your answer
![](https://koobas.hobune.stream/wayback/20220613155706im_/https://answers.unity.com/themes/thub/images/avi.jpg)
Follow this Question
Related Questions
How is this effect created in vfx graph 0 Answers
Unity5.0 Canvas and Particle System 2 Answers
Problem with particles in World simulation space while rotating bones at LateUpdate 0 Answers
[Unity 5.5] How can I set the properties for the ParticleSystem.main by script? 0 Answers
changing the radius of a particle system with unity script 1 Answer