Steps to reproduce:
- Create a new Unity project using a 3D Universal Template
- In the Hierarchy, create an empty GameObject
- Duplicate the created GameObject 3-4 times
- Select the middle two (e.g. "GameObject (2)" and "GameObject (3)") GameObjects in Hierarchy
- In the Inspector, add the "Rect Transform" Component to the selected GameObjects
- Press Ctrl+S to save the Scene
- Click Ctrl+Z to undo
- Observe the Hierarchy
Actual results: The selected GameObjects change their order in the Hierarchy
Expected results: GameObjects should remain in the same order as before (e.g. GameObject (1), GameObject (2), GameObject (3), etc.)
Reproducible with versions: 6000.0.67f1, 6000.3.7f1, 6000.4.0b7
Not reproducible with versions: 6000.3.6f1, 6000.5.0a5
Tested on (OS): macOS 26.2 (M1)
Notes:
- Also reproduces with Components like "Canvas", "Horizontal Layout Group" and etc.