Navigation

  • Recent
  • Tags
  • Users
  • Search
  • Login
Colyseus
  • Login
  • Search
  • Recent
  • Tags
  • Users

Documentation GitHub

We're migrating to GitHub Discussions. This forum does not accept new registrations since April 6, 2023.
  1. Home
  2. lqvinh2
  3. Posts
  • Profile
  • More
    • Continue chat with lqvinh2
    • Flag Profile
    • Following
    • Followers
    • Topics
    • Posts
    • Best
    • Groups

Posts made by lqvinh2

[UNITY] How to create new Scene and match client join

I already have many room and client can connected to every room, now in unity i want to create new Scene. But i dont know how to match client join Scene exactly which client choose.

Please give some recommanded thing to do this

thank all.

posted in Questions & Help • 16 Oct 2020, 02:08
RE: [UNITY] I using broadcast(bc) but server only bc to 1 client itselft

@lqvinh2 said in [UNITY] I using broadcast(bc) but server only bc to 1 client itselft:

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)
void RegisterRecMess()
{
room.OnMessage<Player>("sv_move_right", (plaayer) =>
{
Debug.Log(player);
inputText.text += "__" + player.sessionId;
});
}

async void OnMoveRight()
{
    await room.Send("cl_move_right");
}
posted in Questions & Help • 15 Oct 2020, 03:50
[UNITY] I using broadcast(bc) but server only bc to 1 client itselft

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;
});

posted in Questions & Help • 15 Oct 2020, 03:44

© 2023 Endel Dreyer