Unity crashing after using IEnumerator

I am attempting to make a system where each card spawns in from off screen (doesn’t matter much yet) shows itself off in center screen and then moves downward and into your hand of cards.

None of that really pertains much to my question other than the fact that I need the card to pause upon reaching center-screen.

For now I was just testing yield return new WaitForSeconds(whatever float); but it seems to just crash unity regrades of how I try an implement it into my code.

using System.Collections;
using System.Collections.Generic;
using UnityEngine;

public class TimeLord : MonoBehaviour
{
    public List<GameObject> numbr = new List<GameObject>();
    private int numbrTwo = 7;
    public GameObject placeholder;
    public GameObject prefab;

    public void Start()
    {
        do
        {
            StartCoroutine(Enterhand());
        }
        while (numbr.Count < numbrTwo);
    }

    public IEnumerator Enterhand()
    {
        yield return new WaitForSeconds(.3f);

        placeholder = Instantiate(prefab, new Vector3((0 + numbr.Count), 0, -1), Quaternion.identity);
        numbr.Add(placeholder);
    }

}

I’ve tried to solve this myself. I promise I’ve been searching every forum I can think of, but this is my first script even touching IEnumerators so I am certain it’s probably obvious to the average dev.
(disclaimer, this is not the actual code I was originally working with, I had a lot more variables and MonoBehaviors but I stripped everything else out line by line to see if it was the problem and it really is just this.)

The problem is that you are starting a Coroutine in a loop. Don’t ever do that again. Coroutines are meant to started once and THEN looped inside an IEnumerator Enterhand’s method body.

This is the way.

using System.Collections;
using System.Collections.Generic;
using UnityEngine;

public class TimeLord : MonoBehaviour
{
    public GameObject prefab;
    public List<GameObject> instances = new List<GameObject>();
    int instanceLimit = 7;
    void Start()
    {
        StartCoroutine( Enterhand() );
    }
    IEnumerator Enterhand ()
    {
        var waitTime = new WaitForSeconds(.3f);
        do
        {
            yield return waitTime;

            var instance = Instantiate( prefab , new Vector3((0+instances.Count),0,-1) , Quaternion.identity );
            instances.Add( instance );
        }
        while( instances.Count<instanceLimit );
    }
}

It is a looping problem not coroutine.
do and while loop.
I am at work now so I can’t make a solution for you but probably the issue is this line: while (numbr.Count < numbrTwo);
because it entering the endless loop try to search for it.
And then you have to do something to exit the loop or just use different loop like for, foreach

do while loop is the problem here, you are running a endless loop which may cause crash.

It seems like you have declared a list numbr but you have not assigned any value in that list which means that numbr.count will be 0 always, so that condition inside while (numbr.count > numbrtwo) is always true and it became endless loop forever.

Assigning value to list will solve your problem.