Search Unity

Prevent ParticeSystem from rotation when it is added as a child to rotating object

Discussion in 'Prefabs' started by angel1st, Dec 20, 2019.

  1. angel1st

    angel1st

    Joined:
    Nov 16, 2019
    Posts:
    35
    Hi there,
    I have a Player, which is basically an empty GameObject, where I have as its children a sphere and an trail. The player can roll over the terrain. Now, I would like to add a ParticleSystem to the Player as well, but as soon as I added it, it starts to rotate over the ball. How can I prevent the particle from rotation?
     
  2. doarp

    doarp

    Joined:
    Sep 24, 2019
    Posts:
    147
    In the first settings block of the particle system change the simulation from Local to World and all the particles will be independent from their emitter.
     
  3. angel1st

    angel1st

    Joined:
    Nov 16, 2019
    Posts:
    35
    @doarp - it didn't solve the issue. In fact, if I select the particle system and push "Play" into editor, I can see how the entire PS rotates along with my ball.
    To make things completely clear, let me sketch for you the Player hierarchy:

    • Player (empty game object) - it has Sphere collider and Rigidbody
      • Ball (empty game object)
        • Sphere
      • Particle System

    btw - I tried and move PS inside Ball and even inside Sphere, but it does not help
     
  4. doarp

    doarp

    Joined:
    Sep 24, 2019
    Posts:
    147
    Well then simply don't parent the particle system under the player, but rather gave the particle system transform.position follow the player transform.position in an Update() method.
     
  5. angel1st

    angel1st

    Joined:
    Nov 16, 2019
    Posts:
    35
    Yep, this is what I came up too last night. Thanks for you help anyway!