IEnumerator MoveDrone(int index)
    {
        //position for the drone to head to
        int asteroidIndex = asteroidC.GetRandomAstroidIndex();

        Vector3 endPosition = asteroidC.GetAstroidPosition(asteroidIndex);

        //grab refrence of drones rigidbody
        Rigidbody rb = salvageDrones[index].GetComponent <Rigidbody>();


        bool destination = false;

        //while the drone has not reached its destination loop
        while (destination == false)
        {
            //move the drone

            Vector3 nexPositionStep = Vector3.MoveTowards(salvageDrones[index].transform.position, endPosition, 10.0f * Time.deltaTime);

            Vector3 direction = (endPosition - salvageDrones[index].transform.position);

            float disPlanDrone = Vector3.Distance(salvageDrones[index].transform.position, transform.position);
            // Debug.Log("Distance between drone and Planet: " + disPlanDrone);
            if (disPlanDrone <= transform.lossyScale.x + 1.0f)
            {
                Vector3 dir = transform.position - salvageDrones[index].transform.position;

                direction = -dir; // * (200.0f /*/ (disPlanDrone - transform.lossyScale.x) */);
                //    Debug.Log(direction);
            }

            // salvageDrones[index].transform.LookAt(salvageDrones[index].transform.position - direction);

            // Quaternion.LookRotation(salvageDrones[index].transform.position - direction);


            salvageDrones[index].transform.rotation = Quaternion.RotateTowards(salvageDrones[index].transform.rotation, Quaternion.LookRotation(-direction), 90 * Time.deltaTime);

            //rb.MovePosition(nexPositionStep);
            // rb.velocity = (endPosition - salvageDrones[index].transform.position) * Time.deltaTime * 10.0f;
            //   rb.velocity = (direction *0.5f )  * Time.deltaTime * 7.0f;
            rb.AddForce((direction * 0.5f) * Time.deltaTime * 25.0f);
            //  Debug.Log("Velocity: " + rb.velocity);

            rb.velocity = Vector3.ClampMagnitude(rb.velocity, 4);


            if (Vector3.Distance(rb.transform.position, endPosition) <= 3.0f)
            {
                destination = true;

                rb.velocity = Vector3.zero;
            }
            else
            {
                yield return(null);
            }

            endPosition = asteroidC.GetAstroidPosition(asteroidIndex);
        }


        // the drone waits for a period of time as it deals with its buisness
        yield return(new WaitForSeconds(Random.Range(1, 2)));
    }