public override Vector3 GetForce(Boid boid) { active = arriver.active; Vector3 desired = Vector3.zero; arriver.target = target.transform.position + offset; desired += arriver.GetForce(boid); return(desired - boid.velocity); }
public override Vector3 GetForce(Boid boid) { if (Vector3.Distance(boid.transform.position, path[currentWaypoint]) < arriveDistance) { currentWaypoint++; currentWaypoint %= path.Length; seeker.target = path[currentWaypoint]; arriver.target = path[currentWaypoint]; } return(seeker.GetForce(boid) + arriver.GetForce(boid)); }