Skip to main content

Multiplayer Reference

Local blueprints

Blueprints that have Local selected in the Multiplayer section of the Logic tab.

hi

Actors from these blueprints are only seen on the current device and do not get shared to other devices.

Shared, player-controlled blueprints

Blueprints that have Shared and Player Controlled selected in the Multiplayer section of the Logic tab.

hi

  • Synchronized to other devices in the session.
  • Tend to be used for actors that directly represent or respond to inputs from one player — eg. avatars, actors a player is dragging, temporary text messages, …
  • Destroyed when the controlling user leaves.
  • Actors placed initially in the scene (by dragging from the belt) are created when a user joins, controlled by the user that joined.
  • Actors created from a rule are controlled by the user whose device the rule ran on.
  • On the controlling user's device, responds to controls from behaviors like Analog Stick, Drag and Slingshot; and touch triggers are fired.
  • Rule triggers are fired on the controlling user’s device only.
  • Responses that modify the actor run on the controlling user’s device only.
    • Exception: responses that add tags run on all devices.

Shared, session-controlled blueprints

Blueprints that have Shared and Session Controlled selected in the Multiplayer section of the Logic tab.

hi

  • Synchronized to other devices in the session.
  • Tend to be used for actors that are independent of any particular player — eg. npcs, moving platforms, crates, …
  • Not destroyed when any user leaves, they stick around.
    • Can still be destroyed by rules.
  • Actors placed initially in the scene (by dragging from the belt) are created when the session starts, controlled by the session-controlling-device.
  • Actors created from a rule are controlled by the session-controlling-device, regardless of which device ran the rule.
  • Does not respond to controls from behaviors like Analog Stick, Drag and Slingshot. Touch triggers are not fired.
  • Rule triggers are fired on the session-controlling-device only.
  • Responses that modify the actor run on the session-controlling-device only.
    • Exception: responses that add tags run on all devices.
      • Example: This allows adding an #open tag to a door on collision with an avatar to run on the avatar’s owner’s device. The session-controlling-device could then actually open the door in the “On add tag #open” trigger.

Synchronization

Actors from blueprints with Shared selected are synchronized to other devices in the session.

  • All behavior properties, enable/disable, motion, tags, local variables are synchronized in real-time.
  • Motion is still simulated locally on all devices to keep things looking smooth, but is overridden by motion updates received from the controlling device.

Collisions

Shared actors with Dynamic motion and Solid pass through each other, i.e., they behave as if Solid was turned off for collisions with other Shared Dynamic actors. They still do not pass through Static or Fixed actors.

Collision triggers and the “If colliding” response operate as usual for all collisions.

Usernames

$username in a text actor displays the controlling user’s username.

Session-controlling device

In each session, exactly one device is the “session-controlling-device”. When this device disconnects, some other device is assigned this role. This device runs logic for the session-controlled actors for the session. Player-controlled actors are managed by the controlling player’s device.