Netcode for GameObjects Unity Multiplayer Integration

NOVASOLUTIONS.TECHNOLOGY is engaged in the development, support and maintenance of iOS, Android, PWA mobile applications. We have extensive experience and expertise in publishing mobile applications in popular markets like Google Play, App Store, Amazon, AppGallery and others.
Development and support of all types of mobile applications:
Information and entertainment mobile applications
News apps, games, reference guides, online catalogs, weather apps, fitness and health apps, travel apps, educational apps, social networks and messengers, quizzes, blogs and podcasts, forums, aggregators
E-commerce mobile applications
Online stores, B2B apps, marketplaces, online exchanges, cashback services, exchanges, dropshipping platforms, loyalty programs, food and goods delivery, payment systems.
Business process management mobile applications
CRM systems, ERP systems, project management, sales team tools, financial management, production management, logistics and delivery management, HR management, data monitoring systems
Electronic services mobile applications
Classified ads platforms, online schools, online cinemas, electronic service platforms, cashback platforms, video hosting, thematic portals, online booking and scheduling platforms, online trading platforms

These are just some of the types of mobile applications we work with, and each of them may have its own specific features and functionality, tailored to the specific needs and goals of the client.

Showing 1 of 1 servicesAll 1735 services
Netcode for GameObjects Unity Multiplayer Integration
Complex
~1-2 weeks
FAQ
Our competencies:
Development stages
Latest works
  • image_mobile-applications_feedme_467_0.webp
    Development of a mobile application for FEEDME
    756
  • image_mobile-applications_xoomer_471_0.webp
    Development of a mobile application for XOOMER
    624
  • image_mobile-applications_rhl_428_0.webp
    Development of a mobile application for RHL
    1054
  • image_mobile-applications_zippy_411_0.webp
    Development of a mobile application for ZIPPY
    947
  • image_mobile-applications_affhome_429_0.webp
    Development of a mobile application for Affhome
    862
  • image_mobile-applications_flavors_409_0.webp
    Development of a mobile application for the FLAVORS company
    445

Netcode for GameObjects Integration for Multiplayer (Unity)

Netcode for GameObjects (NGO)—official Unity multiplayer solution, successor to UNET. Unlike Mirror, NGO deeply integrates with Unity Gaming Services: works with Relay, Lobby, Matchmaker out-of-box. For mobile projects, this means fast startup without server infrastructure setup—but lock-in to Unity ecosystem.

NetworkManager and Bootstrap

NGO requires NetworkManager with configured transport. For mobile, recommend UnityTransport with RelayServerData—Unity Relay proxies UDP traffic through their servers, bypassing NAT without dedicated server:

async Task StartHost()
{
    var allocation = await RelayService.Instance.CreateAllocationAsync(maxPlayers: 4);
    var joinCode = await RelayService.Instance.GetJoinCodeAsync(allocation.AllocationId);

    var relayServerData = new RelayServerData(allocation, "udp");
    NetworkManager.Singleton.GetComponent<UnityTransport>()
        .SetRelayServerData(relayServerData);

    NetworkManager.Singleton.StartHost();

    // Share joinCode to Lobby for other players
}

joinCode—6-character string clients use to connect via JoinAllocationAsync. Replaces need for open IP for P2P or dedicated server for small lobbies.

NetworkVariable and State Sync

NetworkVariable<T>—typed variable with automatic sync:

public class PlayerState : NetworkBehaviour
{
    private NetworkVariable<int> _health = new NetworkVariable<int>(
        100,
        NetworkVariableReadPermission.Everyone,
        NetworkVariableWritePermission.Server
    );

    public override void OnNetworkSpawn()
    {
        _health.OnValueChanged += OnHealthChanged;
    }

    private void OnHealthChanged(int previous, int current)
    {
        healthUI.SetValue(current);
    }

    [ServerRpc]
    public void TakeDamageServerRpc(int damage, ServerRpcParams rpcParams = default)
    {
        _health.Value = Mathf.Max(0, _health.Value - damage);
    }
}

NetworkVariableWritePermission.Server—only server writes. NetworkVariableWritePermission.Owner—only owner. Client-side prediction: Owner writes locally, but server is authoritative and can rollback.

NetworkBehaviour and Ownership

NGO strictly separates: IsServer, IsClient, IsHost, IsOwner. IsOwner = true for object this client manages. Typical mistake—not checking IsOwner in Update, then all clients process input for all players.

Ownership transfer: networkObject.ChangeOwnership(clientId)—useful for pickable objects (pick up—become owner).

Boss Room as Reference

Unity published Boss Room—sample NGO project with full coop for mobile. Implements: action-animation sync, anticipation (client plays animation before server confirmation), client-authoritative movement with server correction. Best source for NGO patterns—read before coding.

Lobby and Matchmaking

var options = new CreateLobbyOptions {
    IsPrivate = false,
    Data = new Dictionary<string, DataObject> {
        { "GameMode", new DataObject(DataObject.VisibilityOptions.Public, "deathmatch") },
        { "Map", new DataObject(DataObject.VisibilityOptions.Public, "forest") }
    }
};
var lobby = await LobbyService.Instance.CreateLobbyAsync("My Lobby", 4, options);

Lobby SDK stores metadata, filtering via QueryFilter. Heartbeat via LobbyService.Instance.SendHeartbeatPingAsync—without it, lobby deletes after 30 sec.

Mobile Nuances

Background. NetworkManager.Singleton.Shutdown() on OnApplicationPause(true) on iOS—else Relay connection hangs and doesn't recover on return. On OnApplicationPause(false)StartClient() again with saved joinCode.

Batching. NGO batches messages by default. NetworkConfig.NetworkTickSystem sets tick frequency (30-60 Hz). For turn-based, lower to 10 Hz—fewer batches, less traffic.

Versioning. NetworkConfig.NetworkTickSystem + NetworkConfig.ProtocolVersion—on app update, old clients don't connect to new servers. On mobile, check client version before session start.

Timeline

Basic NGO integration with Relay, Lobby, NetworkVariable for 2-4 players: 1-2 weeks. Full system with client prediction, matchmaking, mobile optimization: 1.5-2.5 months. Cost calculated individually.