Hi I need help with this script.
When I give the object into the field I get this error:
Assets/Script/objArray.js(11,31): BCE0019: ‘name’ is not a member of ‘Object’.
Assets/Script/objArray.js(12,21): BCE0019: ‘transform’ is not a member of ‘Object’.
Sorry for my English
function Start(){
var gameObject = GameObject.Find("root");
var children : Array = new Array();
for (var child : Transform in gameObject.transform) {
children.Add(child);
Debug.Log(child.name); //WORKS
child.transform.position = Vector3(0, 0, 0); //WORKS
}
Debug.Log(children[0].name); // NOT WORKING
children[0].transform.position = Vector3(0, 0, 0); //NOT WORKING
}