Flint Particle System Forum - Stop then restart Particle movement Mon, 12 Dec 2011 22:35:34 +0000 http://flintparticles.org/forum/ Lussumo Vanilla 1.1.10 & Feed Publisher Stop then restart Particle movement http://flintparticles.org/forum/comments.php?DiscussionID=405&Focus=1391#Comment_1391 http://flintparticles.org/forum/comments.php?DiscussionID=405&Focus=1391#Comment_1391 Thu, 30 Sep 2010 10:49:24 +0100 1ndivisible
I've just started using Flint which I'm really enjoying, but I'm a little unclear on something. I want any emitted particles that make contact with a zone to stop moving and collect which I have achieved by creating a custom StopAction (which sets their velocity to 0/0) and using a ZonedAction to apply it. However, I need to be able to release these particles so that they continue onwards with the same velocity as they hit the zone with. Removing the ZonedAction causes the particles to drift off in random directions.

How could I set this up?

Thanks. ]]>
Stop then restart Particle movement http://flintparticles.org/forum/comments.php?DiscussionID=405&Focus=1394#Comment_1394 http://flintparticles.org/forum/comments.php?DiscussionID=405&Focus=1394#Comment_1394 Sat, 02 Oct 2010 15:06:06 +0100 Richard
1. When you stop the particle, store the current velocity in the particle's dictionary, then retrieve it when restarting the particle.

2. Don't use your custom stop action. Instead, apply the move action as a zoned action, using the invertZone property to apply it only to particles outside your zone. Then, when you want to resume the particle's motion, remove the zoned move action and apply a simple move action instead, which will apply to all particles. This way there is no need to set the particle's velocity to zero, so they retain their velocity from before.

I favour option 2. ]]>
Stop then restart Particle movement http://flintparticles.org/forum/comments.php?DiscussionID=405&Focus=1396#Comment_1396 http://flintparticles.org/forum/comments.php?DiscussionID=405&Focus=1396#Comment_1396 Sun, 03 Oct 2010 22:10:28 +0100 1ndivisible
I had blundered my way to number 1, but your second solution is far more elegant. ]]>