1st steps Multiplayer
CharacterController Version 5.0.0 and higher
Download and install the Character Controller Asset from Unity Asset Store:
- Open the scene you want to add the player to
- Choose Tools –> Nonon Zone –> Multi Player Nonon Zone Editor
This will open the NononZone Editor. The prefabs from the asset are already selected.
- Create a floor. Best is to create a 3D Terrain. But a Plane is good too.
- Add a NavMeshSurface to the floor and click bake
- Make sure that your loot spawn points are on the terrain and not under. Distribute your loot a little ..
- In the Nonon Zone Editor now just click on Every “Add to Scene Button”
- All the components will be added to the scene
- SPAWN_POINT: Point where the player will initially spawn
- NononZoneGameControllerNetwork: This component spawn the player
- RESPAW_POINT & NononZONEControllerUINetwork: This is a small UI to respawn the player when he dies.
- PrefabDirectoryNetwork: A list of all Prefabs that will be used in the scene later on (like weapons)
- NononNetworkSpawner: Spawner for the Loot. This component uses the Loot Spawn Points and the PrefabDirectoryNetwork to spawn the loot
- LOOT0-4: Loot Spawn Points which will be instantiated by the NononNetworkSpawner
- NononNetworkManager: This is the Unity Networkmanager. Here you need to register all the Network Objects that you want the engine to spawn for you.
- MultiplyerDevUI: A small UI that helps you start server and client
- Now that all components are setup, open up the Build Settings and add the current scene to your list.
- Build your client and start it two times (or three times for 2 Players)
- Start one with “SERVER” and one with “CLIENT” (and another one with a third client. Choose other names if you do that).
The component has an automated persistence. If you want to setup from scratch, delete the files from your persistance path. You’ll find the path in the Nonon Zone Multiplayer Editor Window