GameObject Root { get; set; }

robot_2Generated
code_blocksInput

Description

Return the root GameObject. The root is the object that is parented to the scene - which could very much be this object.

Usage

Use the Root property to access the root GameObject of the current object. This is useful when you need to perform operations or checks on the top-level object in the scene hierarchy.

Example

// Example of accessing the Root property
GameObject myObject = new GameObject();
GameObject rootObject = myObject.Root;

if (rootObject != null)
{
    // Perform operations on the root object
    rootObject.Name = "RootObject";
}