GameObject is the basic building block of every scene. It has a name, a transform (position, rotation, and scale), and a list of child GameObjects. On its own it does nothing; you attach Components to add behavior.
Properties
A unique identifier for this
GameObject. Assigned at creation and stable for the lifetime of the object. Used internally for scene directory lookups and networking.Display name. Defaults to
"GameObject" if not set. Setting to null silently resets it to "Untitled Object".Whether this
GameObject wants to be active. Setting this to false disables the object and all its components without removing them from the scene. Children are also disabled.Enabled reflects what you set, not whether the object is truly active. Use Active to check whether the object is actually running.True when the object is enabled, in a scene, not network-culled, and every ancestor is also enabled. Components only tick when
Active is true.True if the object has not been destroyed and still belongs to a scene. Check this before using any reference that may have become stale.
True if
Destroy() has been called, even before the actual destruction happens at the start of the next frame.The parent of this object in the hierarchy. Setting to
null re-parents to the scene root. Cannot be set on a Scene object.The direct children of this object. Do not modify this list directly — use
SetParent on the child instead.The scene this object belongs to. Becomes
null after the object is destroyed.Access to position, rotation, and scale. See GameTransform for the full reference.
The tag set for this object. Tags are used to filter traces, queries, and component lookups.
The list of components on this object. Use the component query methods below or
Components.Create<T>() to add new ones.Component methods
GetComponent<T>
T on this object, or null if none exists. Only searches enabled components unless includeDisabled is true.
GetComponents<T>
T on this object.
GetComponentInChildren<T>
GetComponentsInChildren<T>
GetComponentInParent<T> / GetComponentsInParent<T>
AddComponent<T>
T to this object and returns it. This is a shortcut for Components.Create<T>().
GetOrAddComponent<T>
T if one exists, otherwise creates and returns a new one.
Lifecycle methods
Destroy
IsDestroyed returns true immediately.
Clone
GameObject, including all components and child objects. Component property values are copied over. References within the cloned hierarchy are re-wired to point to the clones, not the originals.
SetParent
keepWorldPosition: false to use the current local transform relative to the new parent instead.