I want to send a Broadcast message to unity client, but I have this error, any Idea:
in my Colyseus File Room I have:
onCreate(options: any) {
// configuring room
this.setMetadata({name: options.roomName});
this.setPatchRate(1000 / 20);
// Setting inital state
const state: State = new State();
this.setState(state);
// Listening to client's messages
this.onMessage("initGame", (client, message) => {
const data = new MyMessage();
data.message = "readyToStart";
this.broadcast(data);
});
on unity client:
room.OnMessage<MyMessage>("readyToStart", (message) => {
Debug.Log("message received from server");
Debug.Log(message);
menu.EnableButtonStart();
});