- Home /
Stopping individual Shuriken Particles
Hi there
As the title says, I'm trying to stop individual Shuriken particles so they stay exactly where they are. It almost works with the code below, but the stopped particles are still moving a tiny bit in the same direction:
void LateUpdate()
{
myParticles.GetParticles(particleBuffer);
int numParticles = particleBuffer.Length;
int i = 0;
while(i < numParticles)
{
if(mustThisParticleStop(particleBuffer[i]))
particleBuffer[i].velocity = new Vector3(0, 0, 0);
i++;
}
myParticles.SetParticles(particleBuffer, numParticles);
}
The myParticles obiously modifies the velocity of each particle again, so that's why they continue to move, even tough mustThisParticleStop() does actually return true every frame.
Any hints are greatly welcome! Thanks.
Did you ever solve this? A hacky solution is to record the position and then just rewrite the same position each frame. I've found the velocity vector to act a bit wonky at times. I'd like to learn if you overcame it.
yes, that's exactly what i ended up doing ;-) i ignored the velocity and simply reset the position each frame in LateUpdate.