YunanıDenizeDöken
Femtopat
- Katılım
- 7 Ağustos 2023
- Mesajlar
- 4
Daha fazla
- Cinsiyet
- Erkek
Daha yeni kod yazıyorum o yüzden kızmayın ama unity'de hata veriyor iki yere virgül koymam lazım. Nereye koymam lazım?
İhtiyacınız olursa kodlar:
İhtiyacınız olursa kodlar:
C#:
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
public class PipeSpawnScript : MonoBehaviour
{
public float maxTime = 1;
public float timer = 0;
public GameObject pipe;
public float yukseklik;
void Start()
{
GameObject newpipe = Instantiate(pipe);
newpipe.transform.position = transform.position + new Vector3(0, Random Range(-yukseklik, yukseklik), 0);
}
void Update()
{
if(timer > maxTime)
{
GameObject newpipe = Instantiate(pipe);
newpipe.transform.position = transform.position + new Vector3(0, Random Range(-yukseklik, yukseklik), 0);
Destroy(newpipe,15);
timer = 0;
}
}
}
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
public class PipeSpawnScript : MonoBehaviour
{
public float maxTime = 1;
public float timer = 0;
public GameObject pipe;
public float yukseklik;
void Start()
{
GameObject newpipe = Instantiate(pipe);
newpipe.transform.position = transform.position + new Vector3(0, Random Range(-yukseklik, yukseklik), 0);
}
void Update()
{
if(timer > maxTime)
{
GameObject newpipe = Instantiate(pipe);
newpipe.transform.position = transform.position + new Vector3(0, Random Range(-yukseklik, yukseklik), 0);
Destroy(newpipe,15);
timer = 0;
}
}
}
Dosya Ekleri
Son düzenleyen: Moderatör: