Legacy Documentation: Version 4.5.0

Script language:

  • JS
  • C#
  • Boo
Script language

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

GameObject.activeInHierarchy

var activeInHierarchy: bool;
bool activeInHierarchy;
activeInHierarchy as bool

Description

Is the GameObject active in the scene?

This lets you know if a gameObject is active in the game. That is the case if its GameObject.activeSelf property is enabled, as well as that of all it's parents.

See Also: GameObject.SetActive, GameObject.activeSelf.