"Flocking AI"

Okay, a little situation:
A message is sent out to all the red boxes in the area. this causes them to turn around and come to the blue box who sent out the message.

How could this be done?

When message X track to BLUECUBE and move in local x direction

oh yeah…duh…

I finally tried your idea, and we overlooked one small detail. The result is veery mechanical even when you set the time up some.

ok

I cave

here’s what I really want:
I need turkeys within a certain distance to you to flock to your general area.

I have tried things, but I got no acceptable results. ummm…now help?:smiley:

You could use a ray sensor setup to affect their movement and help them to avoid each other.

cyborg dragon: a little more in depth? I like where you’re going with this…

Give the turkeys their own property and have the turkey itself fire a ray and an object parented to it shooting two more rays going diagonally left and right.
If the left ray hits a turkey, turn the turkey to the right
If the right ray hits a turkey, turn the turkey to the left
If the center ray hits a turkey, maybe just stop its movement.

or slow it down…hmm…I’ll try that out…

Okay…so they’ll avoid eachother…but I need them to “flock” to the area…

ideas?

Create a plane, around the object that you want them to go to. If they collide with the plane then you make them walk in it’s direction. (oh, the plane needs to be invisible)

You could also set a timer that makes them wander in random directions for short periods of time if you wanted