CreatePersistentObject(roomId , persistentObjectStruct)

Description

This function creates a new persistent object in your server in the room you specified. It takes on the properties you list in the persistentObjectStruct as key value pairs

Syntax

CreatePersistentObject(roomId,persistentObjectStruct);

Returns

N/A

Example Implementation

var ball = {
    type: "ball",
    _x : 200,
    _y : 200
}
CreatePersistentObject("public",ball)

This requests the server to create this object in the "public" room.

How to know if the Object was made or not?

After a successful creation of object on your server, the callback function callback_CreatedPersistentObject() is called.

Last updated