- Home /
Error mesige with array functions
hi ime working on a pathing script and i get this error for each of the 2 functions below
Assets/controler.js(22,31): BCE0019: 'Push' is not a member of 'score[]'.
close.Push (val);
open.RemoveAt(num);
val refers to a script and num is a float any help whold be aprichiated.
(sory about speling ime dislexic)
There isn't enough info up there to have much of an idea what's going wrong. What is "close", what is "open", what is score?
Answer by Bryan 4 · May 10, 2011 at 05:28 PM
close must be a score[] im assuming. therefore if you want to call a function of a score. you need close[index].Push(val);
i dont understand but i dont think tats it index comes up as an unknow identifier
Answer by joseph b · May 10, 2011 at 06:01 PM
public var curwp : Transform; public var open : score[]; public var close ; var bestrate : float = 10000; function Start () { open = GetComponentsInChildren.<score>(); }
function Update () { bestrate = 10000; for (var val : score in open){ if (val.tlscr < bestrate){ bestrate = val.tlscr; print (bestrate); } } num = 0; for (var val : score in open){
if (val.tlscr == bestrate){
val.transform.renderer.material.color = Color.magenta;
print (val);
close.Add (val);
print (close);
print ("close = " + close);
open.RemoveAt(num);
}
num += 1;
}
}
sory hears the full script