Search Issue Tracker

Third Party Issue

Third Party Issue in 6000.6.X

Votes

0

Found in

6000.4.0b9

6000.5.0a8

6000.6.0a1

Issue ID

UUM-138153

Regression

Yes

"Object of type 'System.UInt64' cannot be converted to type 'System.Int32'" error when dragging a GameObject from the Hierarchy window

Scene Hierarchy

-

Steps to reproduce:
1. Open the “IN-137905” project
2. Open any scene in the project
3. Select and drag any GameObject from the Hierarchy window
4. Observe the Console window

Actual result: "Object of type 'System.UInt64' cannot be converted to type 'System.Int32'" error is logged
Expected result: No errors in the Console

Reproducible with: 6000.4.0a5, 6000.4.1f1, 6000.5.0a8, 6000.6.0a1
Not reproducible with: 6000.0.71f1, 6000.3.12f1, 6000.4.0a4

Testing environment: Windows 11 Pro, macOS 26.3.1 (M1 Max) (by user)
Not reproducible on: No other environment tested

  1. Resolution Note:

    Thank you for reporting a bug to Unity.

    Our investigation indicates the issue originates from a third-party asset, plugin, or service, rather than Unity itself. Because the problem lies outside our codebase, we're unable to address it directly. Please see these posts for more information:
    https://discussions.unity.com/t/hierarchy-is-completely-broken/1713649
    https://discussions.unity.com/t/cant-drag-and-drop-anything-in-the-hierarchy-in-unity-6-4

    We will close this case as a third-party issue. We recommend contacting the vendor or maintainer for support. If you have evidence that the issue is within Unity, please share it and we will re-open the investigation.

  2. Resolution Note (6000.6.X):

    Thank you for reporting a bug to Unity.

    Our investigation indicates the issue originates from a third-party asset, plugin, or service, rather than Unity itself. Because the problem lies outside our codebase, we're unable to address it directly. Please see these posts for more information:
    https://discussions.unity.com/t/hierarchy-is-completely-broken/1713649
    https://discussions.unity.com/t/cant-drag-and-drop-anything-in-the-hierarchy-in-unity-6-4

    We will close this case as a third-party issue. We recommend contacting the vendor or maintainer for support. If you have evidence that the issue is within Unity, please share it and we will re-open the investigation.

Comments (1)

  1. pablodealeht

    May 07, 2026 20:32

    Title:
    com.unity.ai.generators causes "Object of type 'System.UInt64' cannot be converted to type 'System.Int32'" error on every Hierarchy drag & drop in Unity 6000.4+

    Steps to reproduce:

    Create a Unity 6000.4.x project
    Add com.unity.2d.enhancers (version 1.0.0) to the project — this pulls in com.unity.ai.generators 1.0.0-pre.12 as a dependency
    Open any scene
    Try to drag & drop any GameObject in the Hierarchy window
    Actual result:
    ArgumentException: Object of type 'System.UInt64' cannot be converted to type 'System.Int32' is thrown on every drag attempt. Drop never completes.

    Expected result:
    No errors. Drag & drop works normally.

    Root cause (investigated):

    com.unity.ai.generators 1.0.0-pre.12 registers a Hierarchy drop handler using the old int-based API at editor startup:

    File: Modules/Unity.AI.Generators.UI/Utilities/ExternalFileDragDrop.cs, line 39:

    DragAndDrop.AddDropHandler(HandleDropHierarchy);
    Handler signature (line 231):

    static DragAndDropVisualMode HandleDropHierarchy(
    int dropTargetInstanceID, // <-- old int API
    HierarchyDropFlags dropMode,
    Transform parentForDraggedObjects,
    bool perform)
    In Unity 6000.4+, HierarchyDropHandler changed its first parameter from int to EntityId (ulong). Unity invokes all registered handlers via DynamicInvoke, passing EntityId (UInt64), which fails to convert to the registered handler's int parameter.

    Note: com.unity.2d.sprite (FMOD) already correctly handles this with #if UNITY_6000_4_OR_NEWER guards. com.unity.ai.generators does not.

    Fix:
    Apply the same #if UNITY_6000_4_OR_NEWER pattern to ExternalFileDragDrop.cs:

    #if UNITY_6000_4_OR_NEWER
    static DragAndDropVisualMode HandleDropHierarchy(
    EntityId dropTargetInstanceID, ...)
    #else
    static DragAndDropVisualMode HandleDropHierarchy(
    int dropTargetInstanceID, ...)
    #endif
    Workaround:
    Remove com.unity.2d.enhancers from the project manifest if not in use.

    Versions tested:

    Unity: 6000.4.5f1
    com.unity.ai.generators: 1.0.0-pre.12
    com.unity.2d.enhancers: 1.0.0 (the package that pulls in the dependency)

Add comment

Log in to post comment

All about bugs

View bugs we have successfully reproduced, and vote for the bugs you want to see fixed most urgently.