Legacy Documentation: Version 5.2
LanguageEnglish
  • C#
  • JS

Script language

Select your preferred scripting language. All code snippets will be displayed in this language.

HideFlags.HideInHierarchy

Switch to Manual

Description

The object will not appear in the hierarchy.

using UnityEngine;
using System.Collections;

public class ExampleClass : MonoBehaviour { void Start() { int i = 0; while (i < 5) { GameObject createdGO = GameObject.CreatePrimitive(PrimitiveType.Plane); createdGO.hideFlags = HideFlags.HideInHierarchy; i++; } } }