using UnityEngine; using Unity.Netcode; public class NetworkID : NetworkBehaviour { // Set from enemy spawner public int InitialID = -1; private NetworkVariable nID = new(); public int ID => nID.Value; public override void OnNetworkSpawn() { if (IsServer) nID.Value = InitialID; } }