Search Unity

  1. Welcome to the Unity Forums! Please take the time to read our Code of Conduct to familiarize yourself with the forum rules and how to post constructively.
  2. We’re making changes to the Unity Runtime Fee pricing policy that we announced on September 12th. Access our latest thread for more information!
    Dismiss Notice
  3. Dismiss Notice

Make a particle system rotate with it's parent?

Discussion in 'General Graphics' started by Tovey-Ansell, Dec 8, 2016.

  1. Tovey-Ansell

    Tovey-Ansell

    Joined:
    Jul 8, 2015
    Posts:
    149
    I've found a few threads on this already, but none seemed to give me any answer I could use...

    I have a rocket, and a particle system representing it's exhaust, when the rocket is pointing upright, the exhaust/fire/smoke points directly down, away from the rocket, however when the rocket turns say, 90 degrees, the particle system doesn't rotate, despite being a child of the rocket, this results in the exhaust/fire/smoke still pointing downwards, at a right angle to the rocket's orientation.

    Rotating the particle system within the scene via the editor also has no effect, the particles still all move downwards.

    How can I make the particle system rotate properly? I honestly have no idea this is a problem for a script or the editor

    Any suggestions would be greatly appreciated.

    Thanks,
    Fred T.A
     
    Toma2007 likes this.
  2. PeteUnity3D

    PeteUnity3D

    Unity Technologies

    Joined:
    Jan 4, 2016
    Posts:
    68
    Hi Fred,

    You'll need to change the simulation space if you'd like the inherit the transform of the parent game object.

    https://docs.unity3d.com/ScriptReference/ParticleSystemSimulationSpace.html

    You'll need to create a separate system for anything you want to simulate in world space, like your smoke trail (look at emit by distance for this or the new trail render module in 5.5)
     
    Fred_Ip, withpear, georgezoto and 2 others like this.
  3. richardkettlewell

    richardkettlewell

    Unity Technologies

    Joined:
    Sep 9, 2015
    Posts:
    2,226
    This should work in both Local and World Simulation Space, it shouldn't matter. I even mocked it up in a default scene to prove it... and it works fine for me.

    Are we understanding your question correctly?

    If you want the billboards themselves to be rotated based on the direction of the rocket, then set Billboard Alignment to Local, in the Renderer module.
     

    Attached Files:

  4. karl_jones

    karl_jones

    Unity Technologies

    Joined:
    May 5, 2015
    Posts:
    7,717
    What are the settings on your particle system? Are you using gravity?
    1.gif

    PS: My spaceship is better than Richard's right? ;)
     
  5. theANMATOR2b

    theANMATOR2b

    Joined:
    Jul 12, 2014
    Posts:
    7,790
    Much better - and both are better than Pete's only text post! ;)
    Three Unity developers in a row. This is some quality help here.
     
  6. Tovey-Ansell

    Tovey-Ansell

    Joined:
    Jul 8, 2015
    Posts:
    149
    Honestly wasn't expecting so many replies so fast haha, hugely grateful for all the help!

    The particle system is a child of the rocket, it's simulation space is local, and it's gravity scale is 0.

    Here are some screenies

    http://imgur.com/a/YFEVi

    Any ideas?
     
    Last edited: Dec 10, 2016
    richardkettlewell likes this.
  7. karl_jones

    karl_jones

    Unity Technologies

    Joined:
    May 5, 2015
    Posts:
    7,717
    I copied the values you have in the screenshot but it works for me. Can you show all the settings or idealy share an example project?
     
    Tovey-Ansell likes this.
  8. Tovey-Ansell

    Tovey-Ansell

    Joined:
    Jul 8, 2015
    Posts:
    149
    I'm using the "Flamestrike" particle system from the Pyro Particles pack from the asset store, here, I'll try with a different particle system first, if that doesn't work I'll put a small simple scene together and share that

    Will get back to you ASAP, thanks again :)
     
  9. bgolus

    bgolus

    Joined:
    Dec 7, 2012
    Posts:
    12,192
    You are using the VelocityOverLifetime module, is it set to world space?
     
  10. ifurkend

    ifurkend

    Joined:
    Sep 4, 2012
    Posts:
    350
    I think in this particular case, Simulation space should be "world" instead of "local". Secondly, I suspect that Velocity Over Lifetime and External Force modules are doing something against your intended result which I recommend you to disable them temporarily. Actually it would be better if you can expand those modules to show their values.

    If you want the flame particles emitted quicker as your rocket accelerates, I recommend you to enable Inherit Velocity-initial (which requires world simulation space) and use negative value, maybe -0.2 to -0.6, really you need to experiment by yourself.
     
    richardkettlewell likes this.
  11. Tovey-Ansell

    Tovey-Ansell

    Joined:
    Jul 8, 2015
    Posts:
    149
    FIXED!

    It was indeed set to world space, setting it to local has now made it follow the rotation of the rocket, great spot!

    Thanks everyone for the help, this issue has been bugging me for ages, glad its solved :D
     
  12. superfryme

    superfryme

    Joined:
    Jun 9, 2017
    Posts:
    26
    I had a similar problem and this thread helped me. in the renderer>renderer alignment was not set to local. thanks :-D
     
  13. georgezoto

    georgezoto

    Joined:
    Jan 11, 2018
    Posts:
    1

    Attached Files:

    Last edited: Feb 10, 2018
    Jbs_GameZone and karl_jones like this.
  14. jtruthnick

    jtruthnick

    Joined:
    Apr 21, 2016
    Posts:
    15
    How do you make the arrows align with the direction they're actually moving? Have them point along the same vector they're traveling? Trying to create a "laserblast" effect, and my particles always stay horizontal to the ground plane no matter how I rotate the particle. Tried all the world vs. local settings. thx!
     
  15. karl_jones

    karl_jones

    Unity Technologies

    Joined:
    May 5, 2015
    Posts:
    7,717
    It's In the shape module settings. Align to direction. There is also align to velocity in the renderer.
     
    Last edited: Oct 18, 2018
    richardkettlewell likes this.
  16. DeathApocalypse

    DeathApocalypse

    Joined:
    Sep 29, 2016
    Posts:
    10
    I found a solution,
    just set the StartRotaion like this:
    Code (CSharp):
    1. ParticleSystem shadow;
    2. shadow.startRotation = -transform.rotation.eulerAngles.z/(180.0f/Mathf.PI);
    or if you need all 3 euler angles: than try this way:

    Code (CSharp):
    1. ParticleSystem shadow;
    2. shadow.startRotation3D = -transform.rotation.eulerAngles/(180.0f/Mathf.PI);
     
  17. current666

    current666

    Joined:
    Oct 28, 2018
    Posts:
    4
    It worked for my problem. Thanks!
     
    richardkettlewell likes this.
  18. unity_31130666

    unity_31130666

    Joined:
    Jan 10, 2020
    Posts:
    7
    T
    Thanks Worked for me
     
  19. villalbaweb

    villalbaweb

    Joined:
    Sep 29, 2019
    Posts:
    4
    This is exactly what I was looking for, set the billboard
    This worked for me, thanks Richard!
     
  20. Antonius007

    Antonius007

    Joined:
    Aug 26, 2020
    Posts:
    5
    richardkettlewell likes this.
  21. QuinnWinters

    QuinnWinters

    Joined:
    Dec 31, 2013
    Posts:
    490
    I'm having a similar issue to OP's. This animated example is showing my exact problem. When the spaceship rotates the arrows should rotate with it so they're always pointing toward the rear of the ship. The arrows in the animation always point up as the ship rotates. What does it take to make the arrows rotate with the ship? I'm trying to make tracer rounds come out of a gun and I want them aligned to where the gun is pointing and not coming out of the gun barrel horizontally or at other weird angles. Setting billboard alignment to local does not do the trick.

    Edit: Posted too soon, I've figured it out. It's a combo of things. Simulation space has to be local, shape module has to be set to align to direction, and render mode has to be mesh with a quad. I've been working on this problem for an hour and a half and I figured out the solution 8 minutes after asking for help, haha. Thanks anyway!
     
    Last edited: Jan 28, 2023
    Tovey-Ansell likes this.
  22. olivereld

    olivereld

    Joined:
    Apr 21, 2021
    Posts:
    1


    Try with this.
     

    Attached Files:

  23. Programmer_Junayd

    Programmer_Junayd

    Joined:
    Dec 2, 2021
    Posts:
    1
    It worked for me.
     
    richardkettlewell likes this.