Used to track images in the camera. Moves the containing object's transform to match the detected image. For more information, see the Marker Tracking guide.

//@input Component.MarkerTrackingComponent markerTrackingComponent

// Get whether or not the marker image is being tracked
var isMarkerTracking = script.markerTrackingComponent.isTracking();

// Print current status.
if (isMarkerTracking) {
print("Image is in Camera feed.");
} else {
print("Image is NOT in Camera feed.");
}
interface MarkerTrackingComponent {
    autoEnableWhenTracking: boolean;
    enabled: boolean;
    marker: MarkerAsset;
    onMarkerFound: (() => void);
    onMarkerLost: (() => void);
    sceneObject: SceneObject;
    uniqueIdentifier: string;
    destroy(): void;
    getSceneObject(): SceneObject;
    getTransform(): Transform;
    getTypeName(): string;
    isOfType(type: string): boolean;
    isSame(other: ScriptObject): boolean;
    isTracking(): boolean;
}

Hierarchy (view full)

Properties

autoEnableWhenTracking: boolean

If true, child objects of this Component's SceneObject will be disabled when the marker image is not being tracked.

enabled: boolean

If disabled, the Component will stop enacting its behavior.

marker: MarkerAsset

The marker asset describing the tracking target.

onMarkerFound: (() => void)

A function that gets called when marker tracking begins.

onMarkerLost: (() => void)

A function that gets called when marker tracking is lost.

sceneObject: SceneObject
uniqueIdentifier: string

Methods

  • Destroys the component.

    Returns void

  • Returns the name of this object's type.

    Returns string

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

    Parameters

    • type: string

    Returns boolean

  • Returns true if this object is the same as other. Useful for checking if two references point to the same thing.

    Parameters

    Returns boolean

  • Returns whether the marker image is currently being tracked in camera.

    Returns boolean