You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Should define a new replicator id with the runtime. Creates a new Replicator instance and sets its opaque data to include the replicator id and factory function. Also registers a prefab.
Replicator ids should be stored on the WASM Script Context and unregistered when the script unloads.
Replicators should be defined before the script is loaded. We may be able to register additional replicators at runtime with coordination on id allocation though so we shouldn't limit it yet but should document that the order that defineReplicator is called matters.
Uses the factory function to create a new node. Internally adds the Prefab component, marking the node as an instance of the replicator's prefab. Also adds the Networked and Owned components.
The platformer example will need network synchronized platform positions. We'd like to be able to define these platforms as replicated or synced in editor and then have them automatically synchronize their positions based on who is the host. The host would be the only one running the systems for moving the platforms. The clients would just be receiving the updates and applying them to the platform nodes.
The text was updated successfully, but these errors were encountered:
Basketball Demo WebSG APIs
Network Replication
network.defineReplicator(factoryFn: () => WebSG.Node): Replicator
Should define a new replicator id with the runtime. Creates a new
Replicator
instance and sets its opaque data to include the replicator id and factory function. Also registers a prefab.Replicator ids should be stored on the WASM Script Context and unregistered when the script unloads.
Replicators should be defined before the script is loaded. We may be able to register additional replicators at runtime with coordination on id allocation though so we shouldn't limit it yet but should document that the order that
defineReplicator
is called matters.replicator.spawned(): Iterator<ReplicatorSpawnMessage>
replicator.despawned(): NodeIterator
replicator.spawn(message: string | ArrayBuffer): undefined
Uses the factory function to create a new node. Internally adds the
Prefab
component, marking the node as an instance of the replicator's prefab. Also adds theNetworked
andOwned
components.network.host: Peer
network.local: Peer
network.isHost(): boolean
network.isLocal(): boolean
network.send(peer: Peer, message: string | ArrayBuffer): undefined
network.receive(buffer?: ArrayBuffer): Iterator<NetworkMessage>
Replaces
receive
andreceiveInto
and combines into a single API.Network Peers
peer.id: string
peer.translation: Vector3
peer.rotation: Quaternion
ThirdRoom ActionBar
thirdroom.setActionBarItems(items: ActionBarItems[])
Input
world.input.get(action: string): ButtonState | Vector2 | Vector3
Physics Body
physicsBody.applyImpulse(impulse: ArrayLike<number>): void
Future Considerations
The platformer example will need network synchronized platform positions. We'd like to be able to define these platforms as replicated or synced in editor and then have them automatically synchronize their positions based on who is the host. The host would be the only one running the systems for moving the platforms. The clients would just be receiving the updates and applying them to the platform nodes.
The text was updated successfully, but these errors were encountered: