The public quickstart guide, modified to be headless server and client.
The quickstart is how it sounds, to get a user up and running with a multiplayer scene. It is client authority based, contains very few comments or explanations, and doesnt follow 'best practises', for example firing physical objects rather than raycasting. But it serves its purpose of being a template with basic mirror multiplayer features. :)
Original Guide located here: https://mirror-networking.gitbook.io/docs/community-guides/quick-start-guide
Inside terminal/cmd console, add the complete line, type 0 for default or none.
File Location - Client/Sever - frame rate - host IP - host port - traffic
Example of server arguements: C:\Users\location\QuickStartHeadless s 30 0 0 0
Example of client arguements" C:\Users\location\QuickStartHeadless c 30 123.0.0.123 0 3
- 0 = none (just initial player setup such as name and colour)
- 1 = light (card game) (traffic: 0 + some cmd/rpcs every few seconds)
- 2 = active (social game) (traffic: 1 increased + player rotation only + rigidbody sphere projectile)
- 3 = heavy (mmo) (traffic: 2 increased + player movement)
- 4 = frequent (fps) (traffic: 3 increased)
Port argument section for headless has been temporary disabled, whilst doing the many transport tests. Directly change port to 7777 on NetworkManagers Transport.
1: Download the QuickStart project, open with Unity (made with 2019)
2: Import Mirror from Asset Store or Github Releases
3a: Check the Player Prefab has NetworkTransform on it
3b: Check MyScene NetworkManager has a Transport, you can use any (KCP, Telepathy, LiteNet, Asio, Ignorance etc)
3c: Check the Build Settings has the 2 main scenes, make sure GamesList is set as the first scene.
Also check that these are set in NetworkManager (GamesList - offline map and MyScene - online map)
(Optional, tick Server Build if you want headless versions, non-headless also works.)
4: After you have build the headless from Unity, open up Cmd, and enter the server arguements
(check top of the ReadMe for arguments, server does not need to enter IP address or traffic)
5: Do the same, but enter client arguements, open as many of these as you want.
(check top of the ReadMe for arguments, client can enter 0 as ip for localhost)
6: In Unity Editor, in the GamesList scene, enter your VPS IP Address (or localhost if you are doing everything on same PC)
7: Here you can play, and see the other clients moving around.
Press the Players Canvas button to tally up gameobject players, if you are using a Proximity checker, this will only show those near you.
8: Enjoy! ^_^