Why might Unity not like this code?

I have some code that i’m using to cycle through some spawn points and randomly picking one to spawn from. However every time I click to enter playmode, Unity completely stops working. It doesn’t crash or blue screen or anything like that, but I basically can’t do anything once I click playmode. I’ve had to restart my laptop multiple times now. Here is the code:

using UnityEngine.SceneManagement;
using System.Collections;
using UnityEngine;

public class SpawnBalls : MonoBehaviour
{
    public FireBall ball;
    public Transform[] spawnPoints;
    public float minTime = 0.5f;
    public float maxTime = 1.5f;
    
    float time;
    float spawnTime;

    private void Start()
    {
        time = minTime;
    }
    

    private void Update()
    {
        time += Time.deltaTime;

        if (time >= spawnTime)
        {
            SpawnFireBalls();
        }
    }

    void SpawnFireBalls()
    {
        int randomNum;
        randomNum = Random.Range(0, 14);

        for (int i = 0; i <= spawnPoints.Length; i = randomNum)
        {
            time = 0f;
            //Instantiate(ball, spawnPoints<em>.position, spawnPoints_.rotation, spawnPoints*);*_</em>

Debug.Log(spawnPoints*.name + " spawned a ball");*

}
}
}
Any insight would be greatly appreciated. I’m probably going to look for a different way of executing this but would still like to know if anyone has any idea why this would be happening. Thanks

Your for loop is screwed up. It tries to set i equal to 0, then equal to randomNum, and it never increments i, thus, it turns into an infinite loop. Perhaps you meant to use i += randomNum?

In your SpawnFire balls function the for loop is wrong. It should be

for (int i = 0; i <= spawnPoints.Length; i++)
         {
             spawnPoints *=  randomNum;*

time = 0f;
//Instantiate(ball, spawnPoints.position, spawnPoints_.rotation, spawnPoints*);_
_Debug.Log(spawnPoints.name + " spawned a ball");*_

}