|06 June 2018|
Emit on collision issue
I have a problem and my limited knowledge has me stumped. I have managed to piece together an expression to essentially kill nParticle1 which has an instanced geo connected and on collision emit another nParticle2 I have connected to a different instanced geo.
Now the issue I have is it works to a point but then some particles die before actually colliding with the floor geo and emit nParticle2 in mid air no where near the collision geo also the odd one emits nParticle2 with having had no corresponding collision geo.
I wanted to have random rotations on the second instanced geo so couldnt get rotationsPP to work on creation but seemed to work if I did on first nParticle1 and copied in this expression along with position and velocity, also same as lifespanPP.
Actually all the creation commands on the second nParticle2 wouldn't work unless I put in this expression.
This is what I have in nParticle1 Runtime after dynamics.
$customCollision = nParticleShape1.collisionGeometryIndex;
$pos = nParticleShape1.position;
$rot = nParticleShape1.rotationPP;
$vel = nParticleShape1.velocity;
if ($customCollision !=-1)
if ($customCollision >= 0)
nParticleShape1.lifespanPP = 0;
if (nParticleShape1.age >= nParticleShape1.lifespanPP)
emit -o nParticleShape2 -position ($pos.x) ($pos.y) ($pos.z) -at velocity -vectorValue ($vel.x) ($vel.y) ($vel.z) -at lifespanPP -floatValue 0.50 -at rotationPP -vectorValue ($rot.x) ($rot.y) ($rot.z);
|reply share thread|