using System.Collections;
using System.Collections.Generic;
using UnityEngine;
public class GenerareLevel : MonoBehaviour
{
public GameObject [ ];
public int zPos = 69;
public bool creatingSection = false;
public int secNum;
// Start is called before the first frame update
void Start()
{
if (creatingSection == false); {
creatingSection = true;
StartCoroutine(GenerateSection())
}
}
IEnumenator GenerareSection()
// Update is called once per frame
void Update()
{
secNum = Random.range(0, 3);
Instantiate(section[secnum], new Vector3(0, 0, zPos), Quaternion.identity);
zPos += 69;
yield return new WaitForSeconds(2);
creatingSection = false;
}
}
You forgot a semi-colon ; here
You can try using an IDE like Visual studio, it will tell you whenever you forget something like this, also next time try to share the compile error so we can help you easily