View Single Post
Old 08-13-2018, 08:25 PM
hannahapz hannahapz is offline
Join Date: Apr 2018
Posts: 22
Having objects avoid one another

I made an environment that involves cars traveling at random speeds. At times, certain cars overlap. I want to avoid this by introducing proximity sensors so that when two cars get close to one another, the car in front speeds up.

Right now, the location of my sensors are identical to the location of my targets (i.e. the same car). What can I do to have all the cars be targets for one another AND have their own self sensors, but only involve the front car accelerate when the car behind it gets too close (as opposed to all cars accelerating, which is what my code is doing right now)?

Looking for a solution to my flawed logic.
Reply With Quote