Welcome, Guest
Want to take part in these discussions? Sign in if you have an account, or apply for one below
-
- CommentAuthor1ndivisible
- CommentTimeSep 30th 2010
Hi,
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. -
- CommentAuthorRichard
- CommentTimeOct 2nd 2010
A couple of ideas...
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. -
- CommentAuthor1ndivisible
- CommentTimeOct 3rd 2010
Thanks.
I had blundered my way to number 1, but your second solution is far more elegant.
1 to 3 of 3
