void OnCollisionEnter(Collision collision)
    {
        Collider collider = collision.collider;

        if (collider.CompareTag("Ship"))
        {
            ShipScript ship = collider.gameObject.GetComponent <ShipScript>();
            ship.Die();
            Destroy(gameObject);
        }
        else if (collider.CompareTag("Fort"))
        {
            FortScript fort = collider.gameObject.GetComponent <FortScript>();
            fort.life -= 1;
            Destroy(gameObject);
        }
        else
        {
            Debug.Log("collided with " + collider.tag);
            Destroy(gameObject);
        }
    }
    public Vector3 applyForces(ref Vector3 shipPos, ref Vector3 shipVel, float shipMass, float timestep)
    {
        Vector3 r = shipPos - transform.position;
        float   actualStrength = strength;

        Vector3 rdash = new Vector3(r.x - innerRadius, r.y - innerRadius, r.z - innerRadius);
        Vector3 temp  = new Vector3(outerRadius - rdash.x, outerRadius - rdash.y, outerRadius - rdash.z);

        Vector3 pullVelocity = new Vector3(0.0f, 0.0f, 0.0f);
        Vector3 pullForce    = new Vector3(0.0f, 0.0f, 0.0f);

        if (r.magnitude < innerRadius)
        {
            //destroyship byt sucking it in the blackhole
            ObjectGeneratorScript obs        = GameObject.Find("ObjectGenerator").GetComponent <ObjectGeneratorScript>();
            GamePlayManagerScript gms        = GameObject.Find("GamePlayManager").GetComponent <GamePlayManagerScript>();
            ShipScript            shipscript = obs.playerShip.GetComponent <ShipScript>();

            shipscript.Die();
            gms.StartCoroutine("GameOverandReset");
        }
        else if (r.magnitude < middle1Radius)
        {
            actualStrength *= 2.0f;

            pullVelocity.x = (-r.x / r.sqrMagnitude) * (temp.x / outerRadius) * (actualStrength * innerRadius);
            pullVelocity.y = (-r.y / r.sqrMagnitude) * (temp.y / outerRadius) * (actualStrength * innerRadius);
            pullVelocity.z = (-r.z / r.sqrMagnitude) * (temp.z / outerRadius) * (actualStrength * innerRadius);
            pullForce      = pullVelocity * (shipMass / timestep);
        }
        else if (r.magnitude < middle2Radius)
        {
            actualStrength *= 1.8f;

            pullVelocity.x = (-r.x / r.sqrMagnitude) * (temp.x / outerRadius) * (actualStrength * innerRadius);
            pullVelocity.y = (-r.y / r.sqrMagnitude) * (temp.y / outerRadius) * (actualStrength * innerRadius);
            pullVelocity.z = (-r.z / r.sqrMagnitude) * (temp.z / outerRadius) * (actualStrength * innerRadius);
            pullForce      = pullVelocity * (shipMass / timestep);
        }
        else if (r.magnitude < middle3Radius)
        {
            actualStrength *= 1.5f;

            //change velocity such that it locks to a stable orbit
            if ((orbitalSpeed < (shipVel.magnitude + epsilon)) || (orbitalSpeed > (shipVel.magnitude + epsilon)))
            {
                orbitalSpeed        = shipVel.magnitude;
                orbitalAcceleration = -r.normalized * (orbitalSpeed * orbitalSpeed / r.magnitude);
            }

            pullForce = orbitalAcceleration * shipMass;
        }
        else
        {
            pullVelocity.x = (-r.x / r.sqrMagnitude) * (temp.x / outerRadius) * (actualStrength * innerRadius);
            pullVelocity.y = (-r.y / r.sqrMagnitude) * (temp.y / outerRadius) * (actualStrength * innerRadius);
            pullVelocity.z = (-r.z / r.sqrMagnitude) * (temp.z / outerRadius) * (actualStrength * innerRadius);
            pullForce      = pullVelocity * (shipMass / timestep);
        }

        return(pullForce);
    }