Problem when JoiningLobby from Build

Hello!
I am having a problem when I run the build and try to join the Lobby hosted on Unity Editor.
The “HostLobby” button works fine and it opens the LobbyPageParent GameObject.
The problem comes when I try to join the Lobby on the built version.
It is like it doesn’t recognize it as Client, as neither OnClientConnected nor OnClientDisconnected are called.

Also I noticed something odd: when I host the lobby on the Editor, both the Player Instances are marked as both Server and Client, although the Client does not have Authority and IsNotLocalPlayer.

Editor is hosting:

On the other hand, if I host the lobby from the built version, both players are Clients, but neither of them is Server.

Build is hosting:

Again, I don’t know if this is to be expected or if is an actual problem.
Could anyone help me solve this?

Thank you very much in advance! :smiley:

Edit: I now have noticed that when I try to spawn a Unit clicking on the UnitSpawner, it does not spawn as
HasAuthority is false (even though there is only the host player in the lobby).

This was working until I tried to implement the Lobby.

Hi there,
The information you are seeing in the inspector is correct. When you view the player’s from the host, you are viewing the server versions of all the objects. When you view from client, you are viewing the client versions. You can tell which is player that is playing in that instance by which has authority or is the local player.

To solve the problem you are having, we are trying to get the unit’s to spawn when the client is in the editor, correct?
Can you please but debug.log(connectionId) statements before and after hasAuthority? Did you do this already to confirm that the has authority check is the what’s preventing it from working?

This topic was automatically closed 20 days after the last reply. New replies are no longer allowed.

Privacy & Terms