Question by
Lxyinus · Apr 08, 2019 at 06:00 PM ·
unity 5randomtimerandom.rangetime.deltatime
Increase over time,
I trying to get min from 1 to 5 and max from 10 to 20 in 30 sec. I dont know how. I know how to do it with one value but dont get it to work with two.
public GameObject triangle;
public Transform parentObject;
public float max;
public float min;
void Start()
{
Invoke("spawn", 0.5f);
}
void spawn() {
float random = Random.Range(min, max);
GameObject myTriangleClone = Instantiate(triangle, gameObject.transform.position, gameObject.transform.rotation);
myTriangleClone.transform.parent = parentObject;
Invoke("spawn", random);
}
}
Comment