public override Vector3 Steer(AISteeringController controller)
        {
            float eta = Vector3.Distance(controller.transform.position, target.transform.position) / controller.maxSpeed;

            Vector3 toHeadOff = target.transform.position + ((target.GetHeading() / Time.deltaTime) * eta);

            Debug.Log(toHeadOff);
            return((toHeadOff - controller.transform.position).normalized * controller.maxSpeed);
        }
        public override Vector3 Steer(AISteeringController controller)
        {
            Vector2 wander       = Random.insideUnitCircle.normalized * radius;
            Vector3 displacement = new Vector3(wander.x, 0, wander.y);

            //Vector3 displacement = new Vector3(Random.Range(-1f, 1f), 0, Random.Range(-1f, 1f)).normalized * radius;

            displacement += (target.transform.position - displacement).normalized * jitter;
            displacement.Normalize();
            displacement *= radius;

            displacement += target.GetHeading().normalized *headingDistance;

            return((displacement - controller.transform.position).normalized * controller.maxSpeed);
        }
 public override Vector3 Steer(AISteeringController controller)
 {
     return(Vector3.Cross(target.GetHeading(), Vector3.up).normalized *controller.maxSpeed);
 }
예제 #4
0
 public virtual Vector3 Steer(AISteeringController controller)
 {
     return(Vector3.zero);
 }
 public override Vector3 Steer(AISteeringController controller)
 {
     return((controller.transform.position - target.position).normalized * controller.maxSpeed);
 }