01 January 2011, 03:26 PM
Not sure how that has ever worked. position is local space IIRC. And I believe in this way it will be the center of all particles combined, although you shouldn't quote me on that.
I extended your print statement to give more feedback, and once the first particle goes below the locator in world space, this is what the print statement says:
FIRST PARTICLE POS: .889105
LOCATOR Y POS: 0.911179414.
SHAPE.POS Y: -11.7591055
So lifespanPP doesn't seem to do anything here, and the nParticleShape1.position is giving a completely different position, as I guessed before, it must be local space, as -11 would be far below the locator, while this is not the case.
EDIT: My bad, forgot to set lifespan to lifespanPP only. So lifespanPP does work, but as the position variable isn't giving you a correct variable, it doesn't work as intended. I suggest you change the $ptclpos to something else, depending on the effect you want to create.
To get an accurate world space reading, I just took the position array of a single particle.
float $test = `getParticleAttr -at worldPosition nParticleShape1.pt`;
so then $test would be the translateY.
01 January 2011, 03:58 PM
dank u well!
I forgot to set lifespanPP only, too.
Even though the results of the position value might not be accurate, somehow this works pretty well.
01 January 2011, 09:45 PM
this is how i do it and it works every time
// creation and runtime
float $pos = worldPosition;
lifespanPP = 1000; (whatever number really)
if ($pos.y <= loc.ty)
lifespanPP = 0;
name of your locator is loc and it is positioned where you want it to kill the particles
01 January 2011, 09:46 PM
This thread has been automatically closed as it remained inactive for 12 months. If you wish to continue the discussion, please create a new thread in the appropriate forum.