Question by
kindlycat · Jan 06, 2021 at 08:11 AM ·
editor-scriptingparticlesystemsimulation
ParticleSystem.Simulate API under world space work wrong
the Particle System is set to simulated in world space, and i manually call simulate function from script, but it works still like in local space , that means the particles are like moving with emitter. i guess the simulate API don't memory the position of emitter ,so it will always simulate from current position , so it still works like local space. has anyone known a solution to make it still work like in world space when manually simulating?
void Update()
{
ParticleSystem ps = this.particle.GetComponent<ParticleSystem>();
ParticleSystem.MainModule mm = ps.main;
mm.simulationSpace = ParticleSystemSimulationSpace.World;
ps.Stop(false, ParticleSystemStopBehavior.StopEmittingAndClear);
ps.Play(false);
this.playbackTime += Time.deltaTime;
ps.Simulate(playbackTime, false, false, true);
}
dfa892575ae98221c94151de099ed198.gif
(483.0 kB)
Comment