Unity-Technologies/UnityCsReference · warning · NotImplementedException
GlobalObjectIdentifierToInstanceIDSlow is obsolete. Use Glob
Error message
GlobalObjectIdentifierToInstanceIDSlow is obsolete. Use GlobalObjectIdentifierToEntityIdSlow instead.
What it means
GlobalObjectIdentifierToInstanceIDSlow(GlobalObjectId) is [Obsolete(..., true)] and throws NotImplementedException because the int-instance-ID return concept is being removed in favor of EntityId. The message directs callers to GlobalObjectIdentifierToEntityIdSlow, which returns the strongly-typed EntityId.
Source
Thrown at Editor/Mono/GlobalObjectId.bindings.cs:129
TargetPrefab = targetPrefab
};
return true;
}
// 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
- Replace the call with GlobalObjectIdentifierToEntityIdSlow(id) and consume the EntityId.
- If a raw int is unavoidable downstream, convert the EntityId explicitly at the boundary.
- Migrate storage from int instance IDs to EntityId.
Example fix
// before int instanceId = GlobalObjectId.GlobalObjectIdentifierToInstanceIDSlow(gid); // after EntityId entityId = GlobalObjectId.GlobalObjectIdentifierToEntityIdSlow(gid);
Defensive patterns
Strategy: type-guard
Validate before calling
EntityId entityId = GlobalObjectId.GlobalObjectIdentifierToEntityIdSlow(id);
Prevention
- Use the EntityId-returning reverse-lookup overload.
- Migrate code that expects int instance IDs.
- Enable obsolete-as-error during upgrades.
When it happens
Trigger: Calling the single-id reverse-lookup that returns an int instance ID; legacy code resolving a GlobalObjectId back to an instance ID; plugins not yet migrated.
Common situations: Cross-version Unity upgrade crossing the EntityId migration; copied legacy sample code; tooling that stored GlobalObjectIds and reverse-resolved to ints.
Related errors
- GlobalObjectId.GetGlobalObjectIdSlow(int[], [Out] GlobalObje
- GlobalObjectIdentifiersToInstanceIDsSlow is obsolete. Use Gl
- GetRenderersFilteringResults(ReadOnlySpan<int>) is obsolete.
- GetRenderersHiddenResultBits(ReadOnlySpan<int>) is obsolete.
- EditorApplication.OpenScene() cannot be called when in the U
AI-assisted analysis of Unity-Technologies/UnityCsReference@225b0fbdb5 (2026-08-13).
Data as JSON: /api/errors/7be52c771a2cecf6.
Report an issue: GitHub.