- Home /
select all objects in the hierarchy of an object
hello, I would like to select all objects in the hierarchy of an object. how? thank you! I tried that but it does not work:
Answer by nventimiglia · Jul 07, 2012 at 04:22 PM
void Awake() {
// All objects have a transform
var children = GetComponentsInChildren<Transform>();
}
thanks, but how can I select my script?
var ObjectRender: GameObject; ObjectRender.GetComponentsInChildren("nicescript").enabled=False;
Assets/Script/altri/provachildren.js(7,39): BCE0023: No appropriate version of 'UnityEngine.GameObject.GetComponentInChildren' for the argument list '(String)' was found.
Don't use the quotes around the name to make it the class name.
Your answer
Follow this Question
Related Questions
Object selection 1 Answer
Spawn objects (Instantiate) behind hierarchy 1 Answer
Selecting gameobjects in game, 3 Answers
how to stop tag switching on same object? 1 Answer
Get UnityEngine.Object reference to folder in project from folder path 2 Answers