The name of the Asset in Lens Studio.
ReadonlyuniqueCreate session with the provided options. Will also check if there is a session that can be created from a session sharetype received from other users.
Asks the host application which multiplayer capabilities are available for this Lens launch, before any session exists. The answer is fetched once and reused for the lifetime of this ConnectedLensModule.
Currently it reports matchmaking availability, so call this before
ConnectedLensModule#createSession to decide whether to set
ConnectedLensSessionOptions#matchmakingConfig — attaching a config the host cannot honour fails session
creation with a MatchmakingRejectedByClient error instead. Treat any
ConnectedLensModule.MatchmakingAvailability other than Supported as "create a direct session".
// @input Asset.ConnectedLensModule connectedLensModule
script.connectedLensModule.getMultiplayerSupportInfo(function (multiplayerSupportInfo) {
var options = ConnectedLensSessionOptions.create();
if (multiplayerSupportInfo.matchmakingAvailability ===
ConnectedLensModule.MatchmakingAvailability.Supported) {
options.matchmakingConfig = ConnectedLensModule.MatchmakingConfig.create(1, 4);
}
options.onSessionCreated = onSessionCreated;
options.onError = onError;
script.connectedLensModule.createSession(options);
});
StaticgetReturns the fully-qualified JavaScript type name for this class (for example, "Component.Camera"). This is a static accessor (no instance required) and returns the same value as the instance getTypeName().
Returns the name of this object's type.
Returns true if the object matches or derives from the passed in type.
Returns true if this object is the same as other. Useful for checking if two references point to the same thing.
Leaves the active Connected Lenses session for the local user. The session's onDisconnected callback fires once for the local user. Other participants will remain in the session. After leaving, the MultiplayerSession object can no longer be used — create a new one with ConnectedLensModule#createSession, for example to start a fresh session when you are the last remaining participant.
Share the session with other users, specified by the SessionShareType. Note that if shared via Invitation, a new session will be created. Expect a new onConnected callback with the new session being passed in.
Enables the creation and management of networked Lens experiences, allowing for real-time communication and interaction between users through Connected Lenses.
Remarks
Allows use of networked Lens communication capabilities such as real-time communication, co-located session creation and joining, and shared persistent storage. It's recommended to only use one ConnectedLensModule per Lens.
See
Connected Lenses Overview.
Example