Returns true
if this GameObject
is a root object. Root objects are parented directly to the scene, meaning they do not have a parent GameObject
.
Returns true
if this GameObject
is a root object. Root objects are parented directly to the scene, meaning they do not have a parent GameObject
.
Use the IsRoot
property to determine if a GameObject
is a root object within the scene. This can be useful for operations that need to differentiate between root objects and child objects.
// Example of checking if a GameObject is a root object GameObject myObject = new GameObject(); if (myObject.IsRoot) { // Perform operations specific to root objects Console.WriteLine("This object is a root object."); } else { // Perform operations specific to non-root objects Console.WriteLine("This object is not a root object."); }