Hi everyone, i have this code
function Update () {
//arboles
if (treeinstances < maxtrees)
{
var position: Vector3 = Vector3(Random.Range(transform.position.x - 225, (transform.position.x+225)),0.0,Random.Range(transform.position.z-225, (transform.position.z+225)));
Instantiate(tree, position, Quaternion.identity);
treeinstances += 1 ;
}
This creates trees untill they equal the max amount of trees, I want to do this all in the start function, how would you do it ?