Answers.Body: <p>I solved this using the built in <a href="https://helpx.adobe.com/after-effects/using/simulation-effects.html#foam_effect" rel="nofollow noreferrer">Foam particle render</a> - it does have basic collision avoidance</p>
  
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2018-07-05T14:09:37.823Z
Answers.LastActivityDate: 2018-07-05T14:09:37.823Z
Answers.UserDisplayName: tomh
Answers.Body: <p>I solved it with the enable flocking option
  attract 0%
  separate 20%</p>
  
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2022-10-31T11:36:22.580Z
Answers.Text: In Trapcode Particular?
Answers.UserDisplayName: tomh
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2022-10-28T18:47:01.357Z
Answers.LastActivityDate: 2022-10-28T18:47:01.357Z
Answers.UserDisplayName: Nuria
Body: <p>I need to drive a large number of small 2D cars around on screen in a fairly random fashion... I have the Trapcode Suite.  I'd really like them not to overlap each other.  What's the easiest way to achieve this? Any good tricks using C4Dlite maybe? At the moment I'm using Particular to splatter them all over the screen, and it looks a bit rubbish.</p>
  
Comments.ContentLicense: CC BY-SA 3.0
Comments.CreationDate: 2017-09-19T07:50:28.510Z
Comments.Text: Don't know about C4D, but there is a physics plugin for After Effects called Newton 2 that can achieve that.
Comments.UserDisplayName: MEGA
Comments.ContentLicense: CC BY-SA 3.0
Comments.CreationDate: 2017-09-20T01:22:24.307Z
Comments.Text: You can do it with expressions, there is a sampleImage function which you could call for perimeter points on each car to find out if they're overlapping, https://is.gd/cXC6Il You could also just fudge it by avoiding cars within a certain radius. But it would be super slow for lots of cars. If it was my project I'd do it with a script, using something like the Boids flocking algorithm. https://en.wikipedia.org/wiki/Boids
Comments.UserDisplayName: stib
Tags: <after-effects><after-effects-expressions>
Title: Animating particles with collision avoidance?
UserDisplayName: tomh
ThreadText: # Animating particles with collision avoidance?
  
  (Asked by: username_0 on 2017-09-19)
  
  I need to drive a large number of small 2D cars around on screen in a fairly random fashion... I have the Trapcode Suite. I'd really like them not to overlap each other. What's the easiest way to achieve this? Any good tricks using C4Dlite maybe? At the moment I'm using Particular to splatter them all over the screen, and it looks a bit rubbish.
  
  **Tags:** after-effects, after-effects-expressions
  
  > **Comments:**
  > **username_1**: Don't know about C4D, but there is a physics plugin for After Effects called Newton 2 that can achieve that.  
  > **username_2**: You can do it with expressions, there is a sampleImage function which you could call for perimeter points on each car to find out if they're overlapping, https://is.gd/cXC6Il You could also just fudge it by avoiding cars within a certain radius. But it would be super slow for lots of cars. If it was my project I'd do it with a script, using something like the Boids flocking algorithm. https://en.wikipedia.org/wiki/Boids  
  
  ---
  
  ## 2 answers
  
  ### Answer by username_0 on 2018-07-05. Score: 1
  
  I solved this using the built in [Foam particle render](https://helpx.adobe.com/after-effects/using/simulation-effects.html#foam_effect) - it does have basic collision avoidance
  
  
  ---
  
  ### Answer by username_3 on 2022-10-28. Score: -1
  
  I solved it with the enable flocking option
  attract 0%
  separate 20%
  
  > **Comments:**
  > **username_0**: In Trapcode Particular?  
  
  ---
  
  