i have a function pln(num:float): float{} ...
bizarre error happening, because pln worked in the previous function, same lines, and it halts on error for identical lines in a similar function just after.
first function worked, second make errors for all the lines containing *pln * float*
why does it work in one function and not the other?
function flipstack(N:int) // Stack objects into columns, then make radial copies
{
var plr = Random.Range(0.0,500.0)/500.0;
var full :GameObject = new GameObject("full");
for (var k = 0; k < N; k++)
{
var ino =Instantiate(cube, Vector3(0,k*1+pln(plr +k*6.2),0), Quaternion.identity);// make individual petals
ino.transform.localScale.x = .6 + pln ( plr + k * 0.1345 ) * .5;
ino.transform.localScale.z = .6 + pln ( plr + k * 0.1654 ) * .5;
ino.transform.localScale.y = 1.7 + pln ( plr + k * 0.1421 ) ; //height variable
ino.transform.eulerAngles.y = Random.Range(1,10)*180;
ino.transform.parent = full.transform ;
colrand1(ino);
}
full.transform.localScale = Vector3.one *1;
}
function sidebranches(go:GameObject)//randomly adds sidebranches at + - x
{
if (Random.Value > .3)
{
var plr = Random.Range(0.0,500.0)/500.0;
var ino =Instantiate(cube, go.transform.position, Quaternion.identity);// make individual petals
ino.transform.localScale.x = 1.7 + pln ( plr + k * 0.76 ) ; //VARIABLE X mote to side by this dimension
ino.transform.localScale.y = .5 + pln ( plr + k * 0.25 ) * .4;
ino.transform.localScale.z = .5 + pln ( plr + k * 0.43 ) * .4;
ino.transform.parent = go.parent.transform ;
colrand1(ino);
var ino2 = Instantiate(ino, go.transform.position, Quaternion.identity);// make individual petals
ino2.transform.eulerAngles.y = 180;
ino2.transform.parent = go.parent.transform ;
ino.transform.position.x+= pln ( plr + k * 0.243 ) ;
ino2.transform.position.x-= pln ( plr + k * 0.243 ) ;
}
}
↧