Documentation Index
Fetch the complete documentation index at: https://mintlify.com/ProwlEngine/Prowl/llms.txt
Use this file to discover all available pages before exploring further.
GameObject is the fundamental entity type in Prowl. Every object you place in a scene — characters, lights, cameras, UI roots — is a GameObject. It does not contain gameplay logic itself; instead it acts as a host for MonoBehaviour components that implement behavior. Each GameObject owns a Transform, a parent reference, a list of children, and a collection of components sorted by execution order. GameObject inherits from EngineObject, giving it an InstanceID, an AssetID, a Name, and the two-phase destroy system.
Constructors
- Default
- From Prefab
Core Properties
The
Transform component that controls this object’s position, rotation, and scale. Every GameObject has exactly one Transform; it is not removable.Whether this
GameObject is explicitly enabled. Setting this to false disables the object and all its descendants in the hierarchy, triggering OnDisable on every active MonoBehaviour.true only when this object and every ancestor up to the scene root are all enabled. Read-only; updated automatically when the hierarchy changes.The string tag of this object, resolved through
TagLayerManager. Setting this stores an index internally; reading it looks up the current string for that index.The string layer name, also managed through
TagLayerManager by index.Marks this object as static for baking/batching purposes. Runtime changes may not propagate to all subsystems immediately.
Controls visibility in the editor hierarchy, inspector, and serialization output.
Hierarchy Properties
The direct parent of this object, or
null if this is a scene root object. Use SetParent(...) to modify the hierarchy.The direct children of this object. Treat as read-only; use
SetParent on a child to add or remove it.Shorthand for
children.Count.A persistent GUID that survives serialization round-trips (unlike
InstanceID). Used by the prefab and cloning systems to correlate objects across copies.The
Scene this object belongs to, held as a WeakReference. Returns null if the object has not been added to a scene. Set automatically by Scene.Add(...).The link that connects this object (or one of its ancestors) to a source
Prefab. null for ordinary GameObjects with no prefab ancestry.Walks up the hierarchy to find the nearest
PrefabLink. Returns this object’s own link first, then walks to parents. Returns null if no ancestor has a link.Hierarchy Methods
SetParent
Re-parents thisGameObject under NewParent. Optionally preserves the object’s world-space position and rotation. If the new parent belongs to a different scene, the object is moved to that scene automatically.
The new parent. Pass
null to make this object a scene root.When
true (default), the object’s world-space position, rotation, and scale are preserved by recalculating local values. When false, local transform values are kept, which changes the world position.true if the parent was changed; false if the operation was rejected (e.g. NewParent is a descendant of this object).IsChildOf
Returnstrue if this object is anywhere in the descendant hierarchy of parent. Returns false if this object is the same as parent.
IsParentOf
Returnstrue if this object is a direct parent (or grandparent, etc.) of go. Searches the entire subtree recursively.
IsChildOrSameTransform (static)
Returnstrue if transform is the same as inParent or is one of its descendants.
GetChildrenDeep
Returns all descendants (children, grandchildren, …) of this object in a flat enumerable.GetChildAtIndexPath
Traverses the child hierarchy by following a sequence of child indices and returns the resulting object. Returnsnull if any index is out of range.
GetIndexPathOfChild
Determines the sequence of child indices that leads from this object down to the specified child (or grandchild, etc.).GetSiblingIndex / SetSiblingIndex
Gets or sets the zero-based index of this object within its parent’schildren list. GetSiblingIndex returns null when the object has no parent.
FindChildByIdentifier
Searches this object and optionally all descendants for a child with a matchingGuid identifier. Returns this if this object’s own identifier matches.
Component Management
AddComponent<T>
Adds a new component of typeT to this GameObject. If T carries [RequireComponent], its dependencies are also added automatically. Components are sorted by [ExecutionOrder] after every add.
The newly created and attached component instance.
AddComponent (Type overload)
Non-generic version. Returnsnull if type does not derive from MonoBehaviour.
AddComponent (instance overload)
Attaches an already-constructedMonoBehaviour instance. Useful when you need to configure the component before Awake is called.
RemoveComponent<T>
Removes a specific component instance. CallsOnDisable (if active) and OnDestroy (if started). Will refuse to remove a component that another component declares via [RequireComponent].
The exact component instance to remove.
RemoveComponent (untyped overloads)
RemoveAll<T>
Removes all components of typeT at once.
GetComponent<T>
Returns the first component of typeT attached to this object, or null.
TryGetComponent<T>
Pattern-match variant. Returnstrue and sets component when found.
GetComponents<T>
Returns all components of typeT on this object.
GetComponentInParent<T>
Searches this object (optionally) and walks up through parents until a component of typeT is found.
When
true (default), the search starts with this object itself.When
true, disabled objects in the parent chain are also searched.GetComponentsInParent<T>
Returns all components of typeT across this object and its ancestors.
GetComponentInChildren<T>
Searches this object (optionally) and recurses through children until a component of typeT is found.
GetComponentsInChildren<T>
Returns all components of typeT across this object and all descendants.
GetComponentByIdentifier
Finds a component on this object by its persistentGuid identifier rather than type.
GetComponentInChildrenByIdentifier
Finds a component by persistentGuid identifier, searching this object (optionally) and all its children.
Messaging
BroadcastMessage
Invokes a named method on everyMonoBehaviour attached to this object and all of its children (recursive). Parameters are passed as a params object[].
The method name to invoke via reflection. Searched with
Public | NonPublic | Instance | FlattenHierarchy.Optional arguments forwarded to the method.
SendMessage
Same asBroadcastMessage but limited to components on this object only — does not recurse into children.
CompareTag
Compares this object’s tag against a string, case-insensitively, using the current tag registry.true if the tags match (case-insensitive).Static Factory / Search Methods
Instantiate (GameObject overloads)
Deep-clones an existingGameObject. The no-parent overload explicitly adds the clone to the active scene. The parent and position/rotation overloads call SetParent to place the clone in the hierarchy (which routes it to the correct scene through the parent), but do not call SceneManager.Scene.Add directly.
The template object. Must not be destroyed.
Optional parent to attach the new instance to.
World-space position override applied after cloning.
World-space rotation override applied after cloning.
The cloned
GameObject.Instantiate (Prefab overloads)
Instantiates from anAssetRef<Prefab>. Returns null if the reference is unavailable. The no-parent and with-parent overloads add the clone to the active scene explicitly; the position/rotation overload uses SetParent to place the clone.
Find
Searches all objects in the active scene by name. Returns the first match, ornull.
The name to search for.
When
true, uses OrdinalIgnoreCase matching. Default is false (exact case).FindGameObjectWithTag
Returns the firstGameObject in the scene whose tag matches otherTag (case-insensitive).
FindGameObjectsWithTag
Returns an array of allGameObjects in the scene with the given tag.
Cloning
Clone() performs a deep copy via Prowl’s cloning infrastructure, producing a new GameObject with new InstanceID and component instances. CopyTo copies data into an existing target (used by the prefab apply system).
Serialization
GameObject implements ISerializable and stores the full hierarchy (children, components, transform) into Prowl’s EchoObject format. Normally you interact with this indirectly through SceneManager and the asset pipeline.