Skip to content

What are NetIDs

ZeinaKC edited this page Aug 22, 2026 · 1 revision

Table of Contents

Network Identifiers

A Network Identifier in Mirror Networking is the netId provided by Mirror to all networked objects so the server and clients know which object is which. A network object is what the server uses to control, synchronise, and spawn over the Network. Without the Network Identifier, networked objects would not function as normal.

A networked object will be the following:

  • _Environment
  • Portal (a portal that transitions you to another scene)
  • MapInstance
  • NetNPC
  • Etc...

Mirror assigns these objects with a NetID, which is important for whether or not the object is networked. With MapLoader these objects can range from either a Portal or MapInstance as these components are required to have a Network Identifier to function. Without the NetIDs these portals would not function correctly in multiplayer as a client and will send Unity Error logs in the console. (During singleplayer these are not used in the game, as you're simply the local player.)

For more information, visit Mirror Networking's docs: Network Identity.

Using Network Objects

A network object we can use as an example is the Portal component.
_PORTALS
In Unity these are listed as _entity_portal. In this case we will use the portal for Sanctum Arena:
_entity_portal (Assets/Scenes/map_pvp_sanctumArena.unity -> spawnPoint)

Inspector
In the inspector to the right of Unity, we can see that this GameObject is using a NetworkIdentity component, a Portal component, as well as the Sphere collider. This immediately tells us that the GameObject we are currently using requires a NetID to function.

Here's a technical look of the code used for the Portal component. (ILSpy is a simple decompiler, 100% of the code is not presented accurately and may include errors.)

using System.Runtime.InteropServices;
using Mirror;
using UnityEngine;
using UnityEngine.SceneManagement;

public class Portal : NetworkBehaviour
{
    [Header("Portal Parameters")]
    public ScenePortalData _scenePortal;

    [Space]
    [SyncVar]
    public bool _netDisablePortal;

    public bool _isPortalOpen = true;

    public bool _disableIfSoloMode;

    [Header("Visual")]
    public GameObject _portalVisualContainer;

    public ParticleSystem _portalEffect;

    private AudioSource[] _aSrcCache;

Since we can see that this component is using Mirror and public class Portal : NetworkBehaviour, we can confirm that it requires a NetID.

Simply using this object, it must not be inside of the _Environment GameObject parent as that object is also networked. You also shouldn't mess with anything inside of the component: assetID, Visual, etc... leave them alone.

When you have the object in your scene, you're allowed to do anything you want with it as long as the NetworkIdentity component is left in place. When you are done with said object, you can test your map in multiplayer to see if the client user can enter the portal or not.

Network Identifier don'ts

Don't modify the NetworkIdentity component in the Inspector and don't duplicate objects that share the same NetworkIdentity data. Mirror already assigns each networked object a unique NetID at runtime, and if two objects with the same identity were to appear in the same scene / during a transition, Mirror's safety checks will disable them.

That's why entering a map that shares the same NetID setup as another map can break the transition. When both versions of the object appear at once, Mirror detects the duplicate NetIDs and prevents them from working. So if "Example Map #1" is using a copy of Sanctum Arena's MapInstance, "Example Map #2" can't use a copy of neither "Example Map #1" or Sanctum Arena's MapInstance.

Preventing this problem requires you to place a vanilla network object of another object that isn't a copy of the same object into your scene. These objects already come with valid NetworkIdentity data, including a proper NetID, which MapLoader cannot generate on its own. Repeat this process for every Portal, MapInstance, or _Environment you plan to use. Doing so ensures each one has a unique identity and prevents duplicated NetIDs from appearing in the same scene / during transitions.

It is pretty easy albeit annoying to understand. That's why we rely on asking each other (map developers) for help where possible if any of this is too confusing.


Written by FireNoobsta

Fixing NetIDs

This fix assumes that you have already followed this guide to create a Unity Project for mapping. Our method of decompiling the game's assemblies results in a version of Mirror Networking without any Unity Editor utilities, so networked objectss are not automatically given valid scene IDs when you make a custom map. I copied and slightly modified the code Mirror would use to assign scene IDs to work with this specific Unity Project setup. Download the script and Assembly Definition from the repository overview.

Open your Unity Project. In the project window, look in your Packages folder for ATLYSS and find the Mirror assembly within it.
Find Mirror

Select it and look in the inspector. Check the "Auto Reference" box and apply.
Auto Reference

In your Assets folder, create a new folder called "Editor".
Editor

Within the Editor folder, import NetworkScenePostProcess.cs and NetworkScenePostProcess.asmdef.
Import Scripts

Unity should automatically compile it, and also check the console for any errors. To verify if the script is working, you can duplicate any networked object in your map, save the scene, then close and reopen the scene. Upon reopening you should see a message in the console that looks like this.
Debug Log

Notes

With this script active you should be able to reuse network objects from any other scene since a new scene ID is created when copied to a new scene. Also, when copying an object from one scene to another, you won't see a console message for a new scene ID since a hash based on the scene path already ensures that the IDs will be different.

IMPORTANT: If you duplicate a networked object, a new scene ID is not created until you close and reopen the scene, so remember to do that before building your bundles (also save after reopening).