poon2
April 30, 2024, 1:18pm
1
I have a IJobParticleSystemParallelFor and I want to destroy one single particle in a particle system inside this job when a condition is met.
How can I do that?
apkdev
April 30, 2024, 6:21pm
2
I tried this, it deactivates all other particles aswell…
For some reason when I update the lifetime of one of my particles inside a BurstJob it also updates and in this case kills all other particles that should stay alive.
Code:
[BurstCompile(FloatPrecision.Standard, FloatMode.Fast, CompileSynchronously = true)]
public struct UpdateParticlesJob : IJobParticleSystemParallelForBatch
{
public float deltaTime;
[ReadOnly] public NativeArray<float3> rotations;
[ReadOnly] public NativeArray<float> speeds;
[Read…