Hi, I have a zombie spawn through an Instantiate();. How do I access the component/script of a instantiated prefab? I am asking because I want to have the health get higher every wave. Thanks! Also, if it helps…
if(!GameObject.FindWithTag("Zombie"))
{
countDownWave -= Time.deltaTime;
if(countDownWave <= 0)
{
wave ++;
zombieAmmount += zombieIncrease;
for(var i = 0; i < zombieAmmount; i++)
{
Instantiate(zombie, (spawnPosition[Random.Range(0, 3)]) + Vector3((Random.Range (0, spawnOne.renderer.bounds.size.x)) / 2, 0, (Random.Range (0, spawnOne.renderer.bounds.size.x)) / 2), Quaternion.Euler(0,0,0));
}
countDownWave = waveDelay;
}
}
Thank you!
– dendens2