MMO multiplayer tutorial for Unity with uLink authoritative server

MMO multiplayer tutorial for Unity with uLink authoritative server


Configure the Client

This step of this uLink authoritative server tutorial goes trough the client scene configuration. Since this tutorial uses a simple authoritative server the security checks for cheating are not implemented so the server just assumes that the position communicated by the clients is valid and physic is not calculated on server. With these settings to have a coherent behavior between server and clients you need to have the exact same level configuration, which means that we need to recreate on the client scene the environment of the server scene :

  • Open the client scene, it should only contain a Main Camera.
  • Import the Environment package as we did for the server and place it in the very exact position in the client scene (0,0,0)
  • To enable the connection to the server create a new empty gameobject in the client scene and name it ClientGUI and add as a component the uLink Client GUI script.17-ulink-authoritative-server-multiplayer-tutorial
  • Save the client scene as our work on it is finished for this uLink authoritative server tutorial step.

Building the client and the server

Now it is time to build the project, we will need to build 2 .exe files, one with only the client scene selected from the build box and one with only the server scene selected.

  • Click on File –> Build Settings and add the server and client scene, then check only on of them and press the build button, save the exe with the ticked scene name. Do the same with only the other scene selected, so you should end up with 2 exe files : server.exe and client.exe18-ulink-authoritative-server-multiplayer-tutorial
  • Run the server and then the client, you should be able to connect to localhost and see your character moving on the server. You just built a simple multiplayer game with uLink and an authoritative server setting! You can build more clients and see how many players can connect to your multiplayer game !!


4 thoughts on “MMO multiplayer tutorial for Unity with uLink authoritative server”

  1. I have tried tow ork on this. Somehow my client is stuck in “Instantiating”. I am able to move it though but without any effect on the server. The model seems to come back to the spawn point after any movement in the client.

    • Hi ! Do you use the same Unity and uLink versions of this tutorial? I should check and validate this tutorial also with the latest versions. However the issue you refer to is something i recall experiencing while i was coding, the server is overwriting the transform component, please check your project ,every option of the creator owner and proxy objects should match the tutorial.
      Meanwhile i will review the tutorial to check for bugs, maybe we can sort out your problem together.

      Also after a quick look i added a page with a video of the final result you should get, and a link to the project and compiled files. Carefully check the uLink Network view component options of the Proxy, Owner and Creator gameobjects.

      Thanks for your comment !

  2. I could not switch from manual view id to allocated until i had draged the creator prefab into the project folder! just a heads up for anyone who might have the same problem.

Leave a Comment