Used to track a landmarker in the camera. Moves the SceneObject's transform to match the detected landmarker scene. See the Landmarker guide for more information.

//@input Component.DeviceLocationTrackingComponent locationTrackingComponent

// Get whether or not the landmarker is being tracked
var isLocationTracking = script.locationTrackingComponent.isTracking();

// Print current status.
if (isLocationTracking) {
print("Location is being tracked");
} else {
print("Location is not being tracked");
}
interface DeviceLocationTrackingComponent {
    distanceToLocation: number;
    enabled: boolean;
    location: LocationAsset;
    locationProximityStatus: LocationProximityStatus;
    onLocationDataDownloaded: (() => void);
    onLocationDataDownloadFailed: (() => void);
    onLocationFound: (() => void);
    onLocationLost: (() => 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

distanceToLocation: number

Returns the distance, in meters, to the location. If the distance is unavailable, -1 is returned.

enabled: boolean

If disabled, the Component will stop enacting its behavior.

location: LocationAsset

The location that the tracker is tracking. Useful for dynamically controlling the target location being tracked.

locationProximityStatus: LocationProximityStatus

Returns the user's current LocationProximityStatus. Useful for telling if a user is close enough to the location to track it.

onLocationDataDownloaded: (() => void)

A function that gets called when location data is downloaded.

onLocationDataDownloadFailed: (() => void)

A function that gets called when location data fails to download.

onLocationFound: (() => void)

A function that gets called when location is found.

onLocationLost: (() => void)

A function that gets called when location is lost. Note this will also happen when the user flips the camera.

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 location landmarker is currently being tracked.

    Returns boolean