Hey there, I am pretty new to scripting and am confused by child / parent relationships …
I am trying to set all of the children of a game objects scale to 0 …
here is my script so far that I am dragging onto an object
using UnityEngine;
using System.Collections;
public class ParentChild : MonoBehaviour
{
Renderer[] listOfChildren;
void Start(){
listOfChildren = GetComponentsInChildren<Renderer>();
foreach(Renderer child in listOfChildren)
{
//child.enabled = false;
child.transform.localScale = new Vector3(0, 0, 0);
}
}
}