Log inGet started
World

Builtin Library

Branchmain
Branchesmainpublish
Commit15ce14a4c1

README.md

EditorPresence

Who a client of the world is and what it is doing, carried on the entity that client occupies in edit mode. Every editor and every agent sub-client occupies one such entity (modules.api.editor.presence makes and moves it): a temporary PlayerOwned root, which the edit room relays the way a player's subtree is relayed and the scene never records. It stands at the client's viewpoint.

The client that owns the entity writes the fields; every other client in the same scene draws the participant from them:

  • a view frustum and a camera icon in the participant's colour at its viewpoint, with a name pill (and an agent's current tools) above it; a participant outside the view has its pill held inside the edge of the view that faces it, with an arrow pointing toward it;
  • an outline in the same colour around every entity the participant has selected or changed in the last moments, with a small pill naming the participant above the first of them.

The pills are drawn on one overlay canvas that takes no pointer, so every press reaches the editor beneath it. The Participants overlay of the viewport's debug overlays turns the drawing on and off.

An agent has no viewport of its own, so its entity stands above the work it is doing, and it is shown only while it is changing something. A participant in another scene is not drawn.

Fields

FieldSyncedMeaning
displayNameyesThe person's display name, or the names of the agents working in the client.
kindyes"person" for an editor, "agent" for a sub-client.
sceneyesThe guid of the scene the participant has open.
selectionyesThe entities the participant has selected, comma-separated ids.
editingyesThe entities the participant changed in the last two seconds, comma-separated ids.
activityyesThe tools an agent's calls in flight are running.

Example

The participants this client draws, with what each is doing:

local Presence = require("@builtin::modules.api.editor.presence")
for _, p in ipairs(Presence.participants()) do
    print(p.name, p.kind, p.activity, p.editing)
end