Search Unity

Feedback my Instantiate is broken

Discussion in 'Prefabs' started by Xenfor, May 6, 2021.

  1. Xenfor

    Xenfor

    Joined:
    May 2, 2021
    Posts:
    4
    what should I do?
    Code (CSharp):
    1.  
    2. using System.Collections;
    3. using System.Collections.Generic;
    4. using UnityEngine;
    5.  
    6. public class NewBehaviourScript : MonoBehaviour
    7. {
    8.     Transform tr;
    9.     public GameObject ground;
    10.     public int groundlength;
    11.  
    12.     void Start()
    13.     {
    14.         for (int i = 0; i < groundlength; i++)
    15.         {
    16.             Debug.Log("hello");
    17.             Instantiate(ground, transform.position, Quaternion.identity);
    18.         }
    19.  
    20.          
    21.  
    22.      
    23.     }
    24.  
    25.  
    26. }
    27.  
    28.  
    image:
    adsffdasfdsa.PNG

    I don't use the instantiate command, this is ok