emitToServer
Emit an event to the server.
note
This method can only be called on the client.
Syntax
engine.network.emitToServer(event, data);
Parameters
Name | Type | Description |
---|---|---|
event | string | The event name to emit. |
data (optional) | NetworkEventData | The event data. |
Example
engine.network.emitToServer('onOpenDoor', {
doorId: 1,
status: true,
});
Available on: Client