Relby
Centipat
- Katılım
- 20 Kasım 2023
- Mesajlar
- 96
- Çözümler
- 2
Daha fazla
- Cinsiyet
- Erkek
Flappy Bird oyunu yapıyorum boruların spawn olması için kod bu ve ıenumerator için hata veriyor ne yapmalıyım hata görselde.
C#:
using UnityEngine;
public class Spawner : MonoBehaviour.
{
public Birdy BirdScript;
public GameObject Borular;
public float height;
public float time;
private void Start()
{
StartCoroutine(SpawnObject(time));
}
public IEnumerator SpawnObject(float time)
{
while (BirdScript.isDead)
{
Instantiate (Borular, new Vector3(3, Random.Range(-height, height), 0), Quaternion.identity);
yield return new WaitForSeconds(time);
}
}
}