Search Unity

Particle system question

Discussion in 'General Graphics' started by ArthurUnity2, Sep 11, 2019.

  1. ArthurUnity2

    ArthurUnity2

    Joined:
    Apr 19, 2017
    Posts:
    6
    when i set Set the "Simulation Space" setting of the particle system from "Local" to "World",it the particle missing in game scene,why?
    i use perspective camera and set the particle system be the child of my player to make a trail.
     
  2. karl_jones

    karl_jones

    Unity Technologies

    Joined:
    May 5, 2015
    Posts:
    8,282
    They are not missing, they just changed from Local space(relative to the particle system) to world space(absolute).

    In local space the particle position is relative to the ParticleSystem, to calculate the position in the world we transform it by multiplying its position against the local to world matrix.

    For example if your ParticleSystem was local space and at (500, 10, 10) and a particle was at (10, 0, 0) then the particles position would be calculated as (500 +10, 10 + 0, 10 + 0), ignoring any scale and rotation for this example. If you then changed the system to world space the particles position would be absolute and now at (10, 0, 0), the particle system transform would not be applied to it.

    Changing the simulation space will not convert the existing particles coordinates into the new space. If this is something you want then when you change the space you should also use GetParticles to get the current particles and then convert their position values into the new space.
     
    richardkettlewell likes this.