Problem with instantiating the object in untiy at certain time intervals

Hello Community
I’m a complete beginner in untiy and trying to figure spawn objects randomly at fixed time intervals (every 1 or 2 seconds)… But the issue I’m facing in my script is that the random object is only spawning once and then not spawning…
Where could I be possibly wrong ?

My suggestion would be to use a single “master/controller” script one some empty game object (you may already be doing that), and instead of using a coroutine, I’d try using the Update method instead. The code below should get you started if you wanted to try using Update instead of a coroutine:

private float nextSpawnTime = 0f;
        private List<GameObject> spawnedChars = new List<GameObject>();
        private int maxCharsPlusOne = 11;
        void Update() {
            if (Time.time > nextSpawnTime && spawnedChars.Count < maxCharsPlusOne) {
                nextSpawnTime = Time.time + UnityEngine.Random.Range(1f, 2f);

        void spawnRandom() {
            spawnedChars.Add(Instantiate("insert your params for instaniating"));