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 at the top level of the hierarchy.

Example

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

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