This document provides instructions for setting up a multiplayer tank deathmatch game using Unity's networking features. It describes how to configure networking for player movement, shooting, health, and matchmaking. Key steps include adding NetworkManager and NetworkIdentity components, setting up spawn points, programming client and server tank and projectile movement and damage, and implementing a lobby for matchmaking.
Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...
Unity Korea_Unity Day_Multiplayer
1.
2. 1. The Project
2. The Local Network
3. Spawn Points
4. Local Players
5. Syncing Transforms
6. The Network Manager
7. Shooting
8. Networked Shooting
9. Match Making
10. Adding a Nice Lobby
11. The Lobby Hook
12. Player Health
13. Deathmatch
3. 1. Open Project
2. Open the scene StartingScene
3. Drag in Tank prefab
4. Apply TankController script
5. Save scene as MainGameplay
6. Test scene
7. Stop the play button
4. 1. Create empty GO and name it NetworkManager
1. Add component: Network Manager (not lobby!)
2. Add component: Network Manager HUD
3. Add NetworkIdentity to the Tank prefab
4. Add Tank prefab to spawn info
2. Build and Test for the craziness
5. 1. Create empty object and rename to Spawnpoint
2. Add component: Network Start Position
3. Duplicated 2 or 3 times
4. Set: Player Spawn Method to Round Robin in the Network Manager
5. Build & Run
6. 1. Active: Local Player Authority on the Network Identity of the Tank.
2. Replace the script TankController with TankController_Net which adds:
• Using UnityEngine.Networking
• NetworkBehaviour
• isLocalPlayer
7. 1. Add Network Transform component to the Tank.
2. Rotation Axis to: Y (top-down 2D)
3. Interpolate Rotation Factor: 15
8. 1. Replace the NetworkManager script with the
NetworkManager_CameraControl script
2. Drag and drop the main camera in the open variable: Scene Camera
9. 1. Add an empty GO named GunBarrel to the Tank prefab and align with gun
2. Add TankShooting script to tank prefab
3. Add Shell prefab to the Shell Prefab property on the TankShooting script
4. Add the ShellController script to the Shell prefab
10. 1. Replace the TankShooting script with the TankShooting_Net version
2. Add a NetworkIdentity component to the Shell
3. Replace the ShellController script with the ShellController_Net version on the
Shell
4. Add the Shell prefab to the Spawnable Objects list on the Network Manager
5. Add a NetworkTransform to the Shell prefab
11. 1. Remove the Tank and Network Manager from your scene.
2. Save the scene as Gameplay_Matchmaking
3. Create new scene: Lobby. (save)
4. Add Lobby and Gameplay_Matchmaking to Build Settings
12. 1. Create empty GO and rename it to Network Manager
2. Add Network Lobby Manager and Network Manager HUD components
3. Create empty GO, add component Network Lobby Player, make prefab and
delete it from the scene.
4. Fill in the Lobby Scene, Play Scene, Lobby Player, and Game Player fields
5. Add the Shell to Registered Spawn-able Prefab
6. Set Player Spawn method to: Round Robin
13. 1. Set up the service in through the Cloud Dashboard
14. 1. Open scene : NetworkLobby
2. In build settings switch Lobby scene for NetworkLobby
3. Select the LobbyManager
4. Fill in: Play scene and Game Player Prefab
5. Add Shell prefab to the Registered Spawnable Prefabs
6. Change Player Spawn Method to Round Robin
7. Remove the NetworkLobbyHook script on LobbyManager
15. 1. Add the TankColor script to the Tank prefab
2. Add the script TankColor_Hook to the Lobby Manager
3. Comment and uncomment the SyncVar attribute in the TankColor script to
see the effect
16. 1. Add script TankHealth to the Tank prefab
2. In the scene Gameplay_MatchMaking add UI-> Canvas, then add UI-> text
3. Remove the text value.
4. On the ShellController_Net script (on the Shell prefab), check Can Kill
17. 1. Inspect the DeathMatchManager script
2. Replace the TankHealth script on the Tank prefab with the TankHealth_DM
script
3. Check Is Deathmatch property of the ShellController_Net script on the Shell
prefab