First thing I tried after opening the boids example was reducing it to two birds who only had Cohesion Behaviors. I then made the Cohesion Behaviors aware of everything within 180 degrees and radius of 20.
Strangely, the birds consistently behaved badly. One would head for the edge of the screen and the other would follow (based on the initial positions).
So I looked, and when the center of the boid 'flock' is found in the Cohesion Behavior, it is found in global space rather than 'current boid relative space'. That means that the forces being generated were only proper if the current boid being steered happened to be at the origin.
When I fixed this, the boids continually 'seeked' each other as I was expecting.
Hi!
First thing I tried after opening the boids example was reducing it to two birds who only had Cohesion Behaviors. I then made the Cohesion Behaviors aware of everything within 180 degrees and radius of 20.
Strangely, the birds consistently behaved badly. One would head for the edge of the screen and the other would follow (based on the initial positions).
So I looked, and when the center of the boid 'flock' is found in the Cohesion Behavior, it is found in global space rather than 'current boid relative space'. That means that the forces being generated were only proper if the current boid being steered happened to be at the origin.
When I fixed this, the boids continually 'seeked' each other as I was expecting.
Bug or feature?