While everything was going well, I encountered this error and I’ve been trying to figure out how to fix it for a long time.
using UnityEngine;
public class Spawner : MonoBehaviour
{
public Birdy BirdScript;
public GameObject Borular;
public float height;
public IEnumerator SpawnObject()
{
while (!BirdScript.isDead)
{
Instantiate(Borular, new Vector3(3, Random.Range(-height, heigh),0), Quaternion.identity);
yield return new WaitForSeconds(1f);
}
}
}