Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Help  How to know when all the particles are sleeping so I can de-activate the ObiEmitter
#6
(17-04-2020, 06:34 AM)josemendez Wrote: solverObj.parameters.sleepThreshold;

Thanks!
I've also noticed that when I reload the same scene, the next time I spawn an obiEmitter, the particles will not detect any of the ObiColliders.
The only workaround I have so far is to re-assign the MeshCollider for each ObiCollider on SceneLoad.
Is this expected? What could be causing it?

Also, if for some reason a particle falls from the ground surface into infinite, is there a way to 'force' it to stay at 0, or better yet, to kill it and add it back to the Emitter to spawn again?
Would it be something like this?
Code:
            int solverIndex = bloodEmitter.solverIndices[i];        
            Vector3 particlePos = bloodEmitter.GetParticlePosition(solverIndex);

            //Check if the particle is 'falling' off the ground
            if (particlePos.y < 0f) {
                bloodEmitter.TeleportParticle(solverIndex, bloodEmitter.transform.position);
            }
Reply


Messages In This Thread
RE: How to know when all the particles are sleeping so I can de-activate the ObiEmitter - by facaelectrica - 17-04-2020, 07:34 AM