@urth/metatell-sdk - v0.1.0
    Preparing search index...

    Waypoints

    The root entry exposes two waypoint helpers: getWaypoints() to list the waypoints configured for the room, and warpToWaypoint() to move the current user to one.

    import { getWaypoints, warpToWaypoint } from "@urth/metatell-sdk";
    
    const waypoints = getWaypoints(); // WaypointData[] | null

    for (const wp of waypoints ?? []) {
    console.log(wp.id, wp.name, wp.position);
    }

    getWaypoints() returns null when no waypoint data is available. A WaypointData is:

    type WaypointData = {
    id: string;
    name: string;
    position: { x: number; y: number; z: number };
    };
    warpToWaypoint("entrance");
    

    warpToWaypoint() navigates to the waypoint by setting the URL hash to the waypoint name, which the metatell host uses to move the user. Pass the waypoint's name (not its id).

    • Warping is a teleport, so it is not affected by setMovementEnabled(false) (see User Movement).