Search Unity

Particles darken when detached from parent

Discussion in 'General Graphics' started by TheGrovesy, Jun 29, 2020.

  1. TheGrovesy

    TheGrovesy

    Joined:
    Jan 8, 2013
    Posts:
    25

    My particle system is a child of the bullet, when the bullet hits the ground I detach the particle system by doing:
    TheParticleSystem.transform.parent = null;
    then Destroy the bullet. This allows the particles to finish fading out rather than instantly disappearing.
    However the moment the particle system is detached from the parent object the particles go darker! I'm assuming this has something to do with the lighting and not being associated with the parent object, but dont know for sure. Any ideas what might be causing this?

    The screen capture above shows the particle system on the left side is still attached to the parent bullet, whereas the one on the right is now detached from the bullet, as it has hit the ground, but is clearly much darker!
     
  2. richardkettlewell

    richardkettlewell

    Unity Technologies

    Joined:
    Sep 9, 2015
    Posts:
    2,285
    Do any of the transforms have any scale applied to them?
     
  3. TheGrovesy

    TheGrovesy

    Joined:
    Jan 8, 2013
    Posts:
    25
    @richardkettlewell yes both the parent is scaled down (0.3 on all axes) as does the particle system. Do you think this could somehow be the issue? What happens to a GameObject when its detached from its parent?
     
  4. richardkettlewell

    richardkettlewell

    Unity Technologies

    Joined:
    Sep 9, 2015
    Posts:
    2,285
    It would be an interesting test to set all the scales to 1 and see if it fixes the lighting change.

    If it does, then it seems there is a bug in Unity in this situation.
    A workaround may be to change the scaling mode in the Particle System to Local or Shape (depending what kind of scaling behaviour you actually need in your use-case)

    You could also report this as a bug to us, and we will try to fix it. But that won't help you immediately :)
     
    TheGrovesy likes this.
  5. TheGrovesy

    TheGrovesy

    Joined:
    Jan 8, 2013
    Posts:
    25
    Thank you @richardkettlewell this did somehow appear to be the problem, just changing the parent back to full scale (1.0) fixed the issue. However putting is back the issue did not happen again!!! I will try a bit more to recreate it and if I can I'll report it as a bug. Thanks again.
     
    richardkettlewell likes this.