17-04-2020, 07:34 AM
(This post was last modified: 18-04-2020, 12:22 AM by facaelectrica.)
(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);
}