Description

Replaces the current properties of a shared object with the values given in data.

The data is overwritten, not merged. All the existing properties on shared will be removed and the properties in data will replace them.

You can use this function to set all the properties of a shared object at once:

partySetShared( shared, {x:10, y:10, z:10});

You can use this function to quickly clear a shared object:

partySetShared( shared, {});

Syntax

partySetShared(shared, data)

Parameters

shared

sharedObject: a shared object

data

dataObject: data to write to shared

Returns

nothing

Q+A

Q: Can i use shared = {} instead of partySetShared(shared, {}) ?

A: Those code snippets do very different things. See Don’t Reassign Shared Variables