I have to list out what I’ve done because I’ll forget.
This is making me remember how much I hate using third party tools and having to manage dependencies
It feels like a lot of things are happening behind the scenes that I don’t know.
Code is easy when you know everything that’s happening
With third party apps and installing dependencies and such, you have no idea what’s happening in the background. It just does things
Mirror Installation And Guides
https://mirror-networking.gitbook.io/docs/community-guides/quick-start-guide
https://docs.unity.com/ugs/manual/relay/manual/mirror
Adding Mirror
- Added mirror to my assets:
- https://assetstore.unity.com/packages/tools/network/mirror-129321
- Imported Mirror using Package Manager
- Window > Package Manager > (click on Packages: In Project) Packages: My Assets > Mirror > Download
- Import
- Create new scene, save it, add to build settings
- File > New Scene
- Save it
- File > Build Settings > Add Open Scenes (open the scene in the inspector view if you don’t see it)
- Create new GameObject, name it NetworkManager in the scene, and add 3 components (below)
- Right click, Create Empty
- Drag it to the new scene you created
- Rename by right clicking the game object
- Add the components
- Click on game object > Add Component > Search for the compoent names
- NetworkManager
- KCPTransport
- NetworkManagerHUD
- If you only see creating new script pop up, you didn’t install or import mirror
- Drag your scene into both Offline and Online slots in NetworkManager component
- Assets > Scenes at the below tab
- NetworkManager (game object) > Network Manager (component) > Drag scene game object (in below tab) to Offline Scene and Online Scene
Setting Up the Scene
- Add a simple Plane floor
- Right click in Hierarchy window > 3D Object > Plane
- Set position to (0, -1, 0) and scale to (2, 2, 2)
- Add dirt material
- Assets > Mirror > Examples > _Common > Textures > (Public Domain …) > Drag dirt material (the sphere) onto plane
- Created a new game object and added a NetworkStartPosition component to that object
- Duplicated it 3 times and put it near the corners
- Apparently these are spawn points
Creating the Player
This is something I’ve always had trouble with but it looks simple from the instructions. I’m excited to have a starting point.