dop2000 wow, that does look a lot smoother...looks like fish! I like how you tie in the new vector into the loop and I think you are looking for what is closer? cw or ccw? also great way to fix the 2 spinning off endlessly by randomizing the direction.
I'm no good at RegEx? (whatever its called) can you explain with this is doing?
(loopindex%2=0 ? dir : -dir)*loopindex
I just realized that the video I was following has the c# code included!
github.com/SebLague/Boids/blob/master/Assets/Scripts/Boid.cs
one thing I realize is that to find a new angle he uses SphereCast, which checks for a possible collision of the size of the boid rather than just a ray intersection. (its probably more important for him since he's in 3D). C3 doesn't have anything like that except Overlapping at Offset, but I'm not sure how efficient that is..I'm wondering if that would prevent more collisions?
also I am using bullet behavior whereas he manually calculates the speed/accel/dir. So maybe Bullet is no good here?
velocity += acceleration * Time.deltaTime;
float speed = velocity.magnitude;
Vector3 dir = velocity / speed;
speed = Mathf.Clamp (speed, settings.minSpeed, settings.maxSpeed);
velocity = dir * speed;
cachedTransform.position += velocity * Time.deltaTime;
cachedTransform.forward = dir;
position = cachedTransform.position;
forward = dir;
pretty sure 'forward' in this case means this.forward (as in the boid's movement). same with position.