Skip to content
On this page

Class: Replicator

WebSGNetworking.Replicator

A replicator for spawning and despawning nodes.

Table of contents

Constructors

Methods

Constructors

constructor

new Replicator()

Methods

despawn

despawn(node, data?): void

Despawns a node with the given optional data.

Parameters

NameTypeDescription
nodeNodeThe node to despawn.
data?ArrayBufferOptional data to send with the despawn message.

Returns

void

Defined in

websg.d.ts:2584


despawned

despawned(): ReplicationIterator

Returns an iterator for despawned nodes.

Returns

ReplicationIterator

Defined in

websg.d.ts:2592


spawn

spawn(data?): Node

Spawns a node with the given optional data.

Parameters

NameTypeDescription
data?ArrayBufferOptional data to send with the spawn message.

Returns

Node

Defined in

websg.d.ts:2578


spawned

spawned(): ReplicationIterator

Returns an iterator for spawned nodes.

Returns

ReplicationIterator

Defined in

websg.d.ts:2588