void FixedUpdate() { Vector3 hidePosition; Vector3 hideAccel = hide.GetSteering(target, obstacleSpawner.objs, out hidePosition); Vector3 accel = wallAvoid.GetSteering(hidePosition - transform.position); if (accel.magnitude < 0.005f) { accel = hideAccel; } steeringBasics.Steer(accel); steeringBasics.LookWhereYoureGoing(); }
void FixedUpdate() { if (followPath.IsAtEndOfPath(path)) { path.ReversePath(); } Vector3 accel = wallAvoidance.GetSteering(); if (accel.magnitude < 0.005f) { accel = followPath.GetSteering(path); } steeringBasics.Steer(accel); steeringBasics.LookWhereYoureGoing(); path.Draw(); }