How to reproduce:
- Open the attached "IN-152184" project
- Select "IN-152184 > Rebuild Repro Scene After Reusing Object Slots" from the menu bar
- In a terminal in the project folder, run: “unity command get_scene_hierarchy --json”
- Note the "instanceId" values of the "Subject" GameObject and its children
- Run: “unity command eval 'return UnityEngine.EntityId.ToULong(GameObject.Find("Child_19").GetEntityId()).ToString();'“
- Compare the value from step 5 with the "instanceId" of "Child_19" from step 3
Actual result: Several GameObjects share the same "instanceId", and the "instanceId" of "Child_19" differs from its EntityId
Expected result: Every GameObject has a unique "instanceId" that equals its EntityId
Reproducible with: 0.6.0-exp.1 (6000.6.6f1), 0.8.0-exp.1 (6000.6.6f1, 6000.7.0b6)
Could not test with: 0.2.0-exp.2 - 0.5.0-exp.1 (the Unity CLI version with which the bug was reproduced does not run the reproduction commands with Unity Pipeline package versions older than 0.6.0-exp.1)
Reproducible on: macOS 25.5.0 (M4 Max) (by user), macOS 27.0.1 (M1 Max)
Not reproducible on: No other environments tested
Notes:
- Step 2 runs a script that repeatedly creates and deletes GameObjects in order to increase EntityIds so they are large enough to reproduce the bug. Depending on the Editor version, it may be necessary to perform Step 2 multiple times, or it may not be needed at all
- The "instanceId" values are the EntityIds rounded to the nearest double-precision number, so any EntityId larger than 2^53 (9007199254740992) loses its low digits
- The rounded value can belong to a different live object. Commands that use it act on that object without an error. For example, "unity command set_transform --target instanceId:<rounded instanceId> --position [0,5,0]" may report success but move a different object in some scenes