Optional
jwtRetrieve all visitors currently in a world.
const visitors = await worldActivity.currentVisitors("exampleLandmarkZoneId", true);
Optional
shouldIncludeAdminPermissions: booleanOptional
error?: unknownOptional
message?: stringOptional
params?: objectOptional
sdkRetrieve all visitors currently in a Landmark Zone.
const visitors = await worldActivity.fetchVisitorsInZone({ droppedAssetId: "exampleDroppedAssetId" });
Optional
droppedOptional
shouldMove all visitors currently in a world to a single set of coordinates. Optionally refetch visitors, teleport or walk visitors to new location, and scatter visitors by any number so that they don't all move to the exact same location.
await worldActivity.moveAllVisitors({
shouldFetchVisitors: true,
shouldTeleportVisitors: true,
scatterVisitorsBy: 40,
x: 100,
y: 100,
});
Updates each Visitor instance and worldActivity.visitors map.
Teleport or walk a list of visitors currently in a world to various coordinates.
const visitorsToMove = [
{
visitorObj: worldActivity.visitors["1"],
shouldTeleportVisitor: true,
x: 100,
y: 100
}, {
visitorObj: worldActivity.visitors["2"],
shouldTeleportVisitor: false,
x: 100,
y: 100
}
];
await worldActivity.moveVisitors(visitorsToMove);
Updates each Visitor instance and worldActivity.visitors map.
Summary
Create an instance of WorldActivity class with a given url slug and optional attributes and session credentials.
This class is responsible for all activity of a specified world including editing dropped assets, moving current visitors, etc.
Usage