private Vector3 FollowPath() { //move to next target if close enough to current target (working in //distance squared space) Vector3 wayPoint = m_pPath.CurrentWaypoint(); if ((wayPoint - m_entity.VPos()).sqrMagnitude < m_fWaypointSeekDistSq) { m_pPath.SetNextWaypoint(); } if (!m_pPath.Finished()) { return(FindRoute(m_pPath.CurrentWaypoint())); } else { return(Arrive(m_pPath.CurrentWaypoint(), Deceleration.normal)); } }