If disabled, the Component will stop enacting its behavior.
Readonly
sceneThe scene object this component is on.
Readonly
uniqueDestroys the component.
Returns the SceneObject the component is attached to.
Returns the Transform this component is attached to.
Returns the name of this object's type.
Returns true if the object matches or derives from the passed in type.
Returns true if this object is the same as other
. Useful for checking if two references point to the same thing.
The base class for all components. Components are attached to SceneObject and add various behaviors to it.
Remarks
For example, in the default scene, the
Camera Object
is a scene object which contains the Camera component to render the scene from the point of view of that object. You can add a DeviceTracking component onto the object, so that the Transform of that object is modified based on the device's movement.See
Example
You can add a component to an object by selecting an object in the
Scene Hierarchy
panel, and pressing+ Add Component
in theInspector
panel; or through script:You can access components on an object directyly through script:
or creating an input for it:
Component classes can be a child of other classes. For example, you can get a ClothVisual and EyeColorVisual by asking for the parent MaterialMeshVisual.
You can also write these scripts as TypeScript. Learn more in the TypeScript guide.