An object in the scene hierarchy, containing a Transform and possibly Component. A script can access the SceneObject holding it through the method script.getSceneObject().

// Look for a MaterialMeshVisual on this SceneObject
var sceneObj = script.getSceneObject();
var meshVisual = sceneObj.getComponent("Component.MaterialMeshVisual");
if(meshVisual)
{
// ...
}
// Rename each child SceneObject
var sceneObj = script.getSceneObject();
for(var i=0; i<sceneObj.getChildrenCount(); i++)
{
var child = sceneObj.getChild(i);
var newName = i + "_" + child.name;
child.name = newName;
print(child.name);
}

Hierarchy (View Summary, Expand)

Constructors

Properties

children: SceneObject[]

Get an array of the scene object's children.

enabled: boolean

Whether the SceneObject, including its components and children, is enabled or disabled.

isEnabledInHierarchy: boolean

Returns true if this SceneObject and all of its parents are enabled.

layer: LayerSet

Gets or sets the LayerSet of layers this SceneObject belongs to. This is used to determine which Camera will render the SceneObject.

name: string

The name of the SceneObject.

onDisabled: event0<void>

An event that will trigger when a SceneObject goes from enabled in the hiearchy to disabled in the hiearchy.

onEnabled: event0<void>

An event that will trigger when a SceneObject goes from disabled in the hiearchy to enabled in the hiearchy.

uniqueIdentifier: string

Methods

  • Copies component and adds it to the SceneObject, then returns it.

    Type Parameters

    Parameters

    • component: K

    Returns K

  • Creates a shallow copy of the passed in sceneObject (not including its hierarchy), and parents it to this SceneObject.

    Parameters

    Returns SceneObject

  • Creates a deep copy of the passed in sceneObject (including its hierarchy), and parents it to this SceneObject.

    Parameters

    Returns SceneObject

  • Destroys the SceneObject.

    Returns void

  • Returns this SceneObject's child at index index.

    Parameters

    • index: number

    Returns SceneObject

  • Returns the number of children the SceneObject has.

    Returns number

  • Returns the SceneObject's parent in the hierarchy, or null if there isn't one.

    Returns SceneObject

  • Returns the Transform attached to the SceneObject.

    Returns Transform

  • Returns whether the SceneObject has a parent in the scene hierarchy.

    Returns boolean

  • Returns true if the object matches or derives from the passed in type.

    Parameters

    • type: string

    Returns boolean

  • Unparents the SceneObject in the hierarchy, making it an orphan.

    Returns void

  • Sets the SceneObject's parent to newParent in the scene hierarchy.

    Parameters

    Returns void

  • Changes the parent of the SceneObject without altering its world position, rotation, or scale.

    Parameters

    Returns void

MMNEPVFCICPMFPCPTTAAATR