Spawning Crashes Unity

I am writing a script to randomly spawn a planet across the screen. However, when this script runs Unity crashes (It does not respond).

    public float ScreenXMin;
    public float ScreenXMax;
    public float ScreenYMin;
    public float ScreenYMax;
    private Vector2 SpawnPlace;

    public GameObject planet;

    private float PlanNum;

    private int i;

    // Use this for initialization
	void Start () {
        ScreenXMax = Screen.height;
        ScreenYMax = Screen.width;

        ScreenXMin = 0;
        ScreenYMin = 0;

        SpawnPlace.x = Random.Range(ScreenXMin, ScreenXMax);
        SpawnPlace.y = Random.Range(ScreenYMin, ScreenYMax);

        PlanNum = Random.Range(4, 8);

        while (i != PlanNum)
            Instantiate(planet, SpawnPlace, transform.rotation);

i think it’s because plannum is a float and int i is a integer, that will lead to integer vs randomranged floats maybe change float planNum to int