Unity-Technologies/UnityCsReference · warning · NotImplementedException

GlobalObjectIdentifiersToInstanceIDsSlow is obsolete. Use Gl

Error message

GlobalObjectIdentifiersToInstanceIDsSlow is obsolete. Use GlobalObjectIdentifiersToEntityIdsSlow instead.

What it means

GlobalObjectIdentifiersToInstanceIDsSlow(GlobalObjectId[], int[]) is the batch reverse-lookup overload marked [Obsolete(..., true)]; it throws NotImplementedException pointing to GlobalObjectIdentifiersToEntityIdsSlow which writes EntityId[] instead of int[]. The migration removes int instance IDs from the batch path too.

Source

Thrown at Editor/Mono/GlobalObjectId.bindings.cs:134

        // Converting one object at a time is incredibly slow. (Have to iterate whole scene to grab one object...)
        // Always prefer using batch API when multiple objects need to be looked up.
        [FreeFunction]
        extern public static UnityEngine.Object GlobalObjectIdentifierToObjectSlow(GlobalObjectId id);
        [FreeFunction]
        extern public static void GlobalObjectIdentifiersToObjectsSlow(GlobalObjectId[] identifiers, [Out] UnityEngine.Object[] outputObjects);

        // Converting one object at a time is incredibly slow. (Have to iterate whole scene to grab one object...)
        // Always prefer using batch API when multiple objects need to be looked up.
        [Obsolete("GlobalObjectIdentifierToInstanceIDSlow is obsolete. Use GlobalObjectIdentifierToEntityIdSlow instead.", true)]
        public static int GlobalObjectIdentifierToInstanceIDSlow(GlobalObjectId id)
        {
            throw new System.NotImplementedException("GlobalObjectIdentifierToInstanceIDSlow is obsolete. Use GlobalObjectIdentifierToEntityIdSlow instead.");
        }
        [Obsolete("GlobalObjectIdentifiersToInstanceIDsSlow is obsolete. Use GlobalObjectIdentifiersToEntityIdsSlow instead.", true)]
        public static void GlobalObjectIdentifiersToInstanceIDsSlow(GlobalObjectId[] identifiers, [Out] int[] outputInstanceIDs)
        {
            throw new System.NotImplementedException("GlobalObjectIdentifiersToInstanceIDsSlow is obsolete. Use GlobalObjectIdentifiersToEntityIdsSlow instead.");
        }

        [FreeFunction]
        extern public static EntityId GlobalObjectIdentifierToEntityIdSlow(GlobalObjectId id);
        [FreeFunction]
        extern public static void GlobalObjectIdentifiersToEntityIdsSlow(GlobalObjectId[] identifiers, [Out] EntityId[] outputEntityIds);

    }
}

View on GitHub (pinned to 225b0fbdb5)

Solutions

  1. Switch to GlobalObjectIdentifiersToEntityIdsSlow(ids, outputEntityIds) with an EntityId[] buffer.
  2. Allocate the output buffer as EntityId[] sized to the input length.
  3. Update dependent libraries to EntityId-aware versions.

Example fix

// before
int[] instanceIds = new int[guids.Length];
GlobalObjectId.GlobalObjectIdentifiersToInstanceIDsSlow(guids, instanceIds);

// after
EntityId[] entityIds = new EntityId[guids.Length];
GlobalObjectId.GlobalObjectIdentifiersToEntityIdsSlow(guids, entityIds);
Defensive patterns

Strategy: type-guard

Validate before calling

EntityId[] entityIds = new EntityId[identifiers.Length];
GlobalObjectId.GlobalObjectIdentifiersToEntityIdsSlow(identifiers, entityIds);

Prevention

When it happens

Trigger: Calling the batch reverse-lookup with an int[] output buffer; legacy code resolving many GlobalObjectIds to instance IDs at once; plugins predating the EntityId API.

Common situations: Unity version upgrade across the EntityId boundary; performance-sensitive batch code still on ints; third-party package not yet migrated.

Related errors


AI-assisted analysis of Unity-Technologies/UnityCsReference@225b0fbdb5 (2026-08-13). Data as JSON: /api/errors/c27b2efc3b83bc69. Report an issue: GitHub.