Unity NGO
Explore how to host Unity projects on Edgegap using techniques from the NGO Boss Room Sample.
✔️ Preparation
Before we start, you will need:
Unity 6 - download using Unity Hub,
Unity NGO [Netcode for Game Objects] Boss Room Sample project (modified for Edgegap):
⚡ Deploy and Connect
1. Deploy a Server on Edgegap
☑️ To get started, you'll need to create a free account with Edgegap. No credit card required.
☑️ Create a new app version for your application, choose NGO Boss Room Sample.
☑️ Deploy a server with your NGO Boss Room Sample app version.
☑️ Open your new deployment's details and find your unique, one-time connection details:
External Port in format
30854(5 digits).
☑️ Navigate to tab Logs and find (CTRL+F) your unique, one-time connection details:
ARBITRIUM_PUBLIC_IPin format172.234.244.38.
✅ You may now proceed to the next step.
2. Connect from Editor
☑️ Open your new project in Unity.
☑️ Verify that you have opened scene: Assets/Scenes/MainMenu.unity.
☑️ Press the ▶️ Play button to start your game client:
press START WITH DIRECT IP button,
select tab JOIN WITH IP.
☑️ Input connection details from previous step.
☑️ Press JOIN button to connect to your server.
☑️ Connect a second virtual Player with Multiplayer Play Mode or ParrelSync.
🙌 Congratulations on your first Deployment on Edgegap!
✏️ Customize Server Build
See Unity for Unity to learn how to build and customize servers.
Run as Dedicated Server
For this sample to run as dedicated server, we made the following changes:
New script (added to your MainMenu scene in a new empty GameObject):
using System;
using System.Collections;
using System.Collections.Generic;
using Unity.BossRoom.ConnectionManagement;
using UnityEngine;
namespace Unity.Multiplayer.Samples.BossRoom
{
public class EdgegapServerStarter : MonoBehaviour
{
public string portMapName = ;
// Start is called before the first frame update
void Start()
{
if (Application.isBatchMode)
{
ConnectionManager connectionManager = GameObject.Find("ConnectionManager").GetComponent<ConnectionManager>();
string internalPortAsStr = Environment.GetEnvironmentVariable($"ARBITRIUM_PORT_{portMapName.ToUpper()}_INTERNAL");
if (internalPortAsStr == null || !ushort.TryParse(internalPortAsStr, out ushort port))
{
throw new Exception($"Could not find port mapping, make sure your app version port name matches with \"{portMapName}\"");
}
connectionManager.StartHostIp("", "0.0.0.0", port);
}
}
}
}Modified files:
116 public override async Task SetupHostConnectionAsync()
117 {
118
119 var utp = (UnityTransport)m_ConnectionManager.NetworkManager.NetworkConfig.NetworkTransport;
120 utp.SetConnectionData(m_Ipaddress, m_Port);
121 }66 async void StartHost()
67 {
...
72 // NGO's StartHost launches everything
--
73
74 {
75 StartHostFailed();
76 }
...112 public override void OnNetworkSpawn()
113 {
...
125 m_ServerCharacter.IsStealthy.OnValueChanged += OnStealthyChanged;
126 m_ServerCharacter.MovementStatus.OnValueChanged += OnMovementStatusChanged;
127
...Modify files:
148 ConnectStatus GetConnectStatus(ConnectionPayload connectionPayload)
149 {
...
155
156 //{
157 // return ConnectStatus.IncompatibleBuildType;
158 //}
...Last updated
Was this helpful?

