PDA

View Full Version : Make particle die with catch.


dim1984kimo
12-12-2009, 12:05 AM
Hi,

How to make particle die with some conditions?

For instance,

A: Particle will die when its Y position < 0.

B: Particle will die when it collides on a surface.

C: Particle will die when its speed higher or lower than a limit value. But if the option is "lower than a value" , it must has two conditions to listen, such as lifespan. For example, particle will die when its speed lower than 5 and lifespan higher than 10.

Bonedaddy
12-12-2009, 12:17 AM
A: Particle will die when its Y position < 0.


Runtime expression:
$pos=particle1Shape.position;
if ($pos.y<0) { particle1Shape.lifespanPP=0; }



B: Particle will die when it collides on a surface.


Look at the particle collision events, that's built in.


C: Particle will die when its speed higher or lower than a limit value. But if the option is "lower than a value" , it must has two conditions to listen, such as lifespan. For example, particle will die when its speed lower than 5 and lifespan higher than 10.

Runtime expression:
if(mag(particle1Shape.velocity)<5 && particle1Shape.lifespanPP>10) { particle1Shape.lifespanPP=0; }

dim1984kimo
12-12-2009, 02:51 AM
Hi, Jason

Thank you very much!

You inspire me.

CGTalk Moderation
12-12-2009, 02:51 AM
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.