Scene change and creative cube game object

After saving the pre-stored r and specific values of the Sentence array in the Input_data array,

change the scene to Equip3D, and then use the values stored in Input_data to create a gameobject cube(Input_data array is used for position and size)

At this time, the scene is switched, but objects are not created after that.

Even if I take a log, it runs without any error

Can I know how to fix it?

Here are source code:

public void Find_Out(){

        for (int j=0; j<r; j++){


            for (int k=0; k<7; k++){


                Input_data [j,k]=Sentence[(int)Input_i[j],k+4];


                Debug.Log("j= " + j +" k= " + k + " Item= " + Input_data[j,k]);




    for (int i=0; i<r; i++){

        GameObject equipment = GameObject.CreatePrimitive(PrimitiveType.Cube);[i,0]; //장비 이름

        equipment.transform.position = new Vector3(float.Parse(Input_data[i,1]), float.Parse(Input_data[i,3]), float.Parse(Input_data[i,2])); //y 대칭

        equipment.transform.localScale = new Vector3(float.Parse(Input_data[i,4]), float.Parse(Input_data[i,6]), float.Parse(Input_data[i,5])); //z 대칭

        Debug.Log("Scene Change!!!");




I think you should wait with the object creation until the scene has loaded to 90%.

bool bBeginCreatingObjects = false;
bool bDoneCreatingObjects = false;
bool bBeginLoadScene = true; //begins immediately, you can remove this and do it in a state machine
bool bDoneLoadScene = false;
string szToLoad = "Equip3D";
void Update()
        bDoneLoadScene = false;
        bBeginCreatingObjects = false;
		bDoneCreatingObjects = false;
		bBeginLoadScene = false;
    if(bBeginCreatingObjects && !bDoneCreatingObjects)
        //here you have the chance to not create all objects the same frame
        // you can split the for loop into different states in a state machine
        for (int i=0; i<r; i++)
            GameObject equipment = GameObject.CreatePrimitive(PrimitiveType.Cube);
		bDoneCreatingObjects = true;

IEnumerator LoadAsyncScene()
    AsyncOperation asyncLoad = SceneManager.LoadSceneAsync(szToLoad, LoadSceneMode.Single);
    asyncLoad.allowSceneActivation = false;
    //wait until the asynchronous scene fully loads
    while (!asyncLoad.isDone)
        //scene has loaded as much as possible, the last 10% can't be multi-threaded
        if (asyncLoad.progress >= 0.9f)
            bBeginCreatingObjects = true;
            if (bDoneCreatingObjects)
                asyncLoad.allowSceneActivation = true;
        yield return null;
    bDoneLoadScene = asyncLoad.isDone;