I’m having a problem with GetComponentInChildren. I get an error saying : BCE0019: ‘GetComponentInChildren’ is not a member of ‘Object’.
This is my code:
function SetRandomNumbers ()
{
for(var child in transform)
{
var weight : int;
weight = Random.Range(0,10);
child.GetComponentInChildren(TextMesh).text = weight.ToString();
}
}
Thanks for your help!