SERVER CODE
onCreate (options: any) {
this.setState(new State());
this.setMetadata({
str: "hello",
number: 10
});
this.setPatchRate(1000 / 20);
this.setSimulationInterval((dt) => this.update(dt));
this.onMessage("cl_move_right", (client) => {
const p = this.state.players[client.sessionId];
this.broadcast("sv_move_right", p );
})
}
// CLIENT (UNITY)
room.OnMessage<Player>("sv_move_right", (plaayer) =>
{
Debug.Log(player);
inputText.text += "__" + player.sessionId;
});