Emit on collision issue

Become a member of the CGSociety

Connect, Share, and Learn with our Large Growing CG Art Community. It's Free!

 
Thread Tools Display Modes
  06 June 2018
Emit on collision issue

Hi,
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



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
CGSociety
Society of Digital Artists
www.cgsociety.org

Powered by vBulletin
Copyright 2000 - 2006,
Jelsoft Enterprises Ltd.
Minimize Ads
Forum Jump
Miscellaneous

All times are GMT. The time now is 01:51 PM.


Powered by vBulletin
Copyright ©2000 - 2018, Jelsoft Enterprises Ltd.