Search Issue Tracker
Won't Fix
Votes
0
Found in
2017.4
2017.4.30f1
2018.4
2019.2
2019.3
2020.1
Issue ID
1176049
Regression
No
Values are not assigned by script when prefab is dragged to Scene window and using Undo.RecordObject method
How to reproduce:
1. Open the attached 'project-1176049.zip' project using the EnvIronman VM (optional) (more information in Edit).
2. In Project window select 'Cube' prefab and drag it to the Scene window
Expected result: values are assigned by Script to prefab's variables
Actual result: values are not assigned by Script to prefab's variables
Reproducible with: 2017.4.32f1, 2018.4.7f1, 2019.2.2f1, 2019.3.0a12, 2020.1.0a1
Notes:
1) Dragging the prefab to the Hierarchy window assigns Script's values to the prefab's variables
2) Script's values are assigned to prefab's variables in both situations when 'Undo.RecordObject' method is not used
3) Dragging the prefab to Scene window (without releasing it) and then dragging it to the Hierarchy window throws the following exception:
ArgumentOutOfRangeException: Index was out of range. Must be non-negative and less than the size of the collection.
Parameter name: index
System.ThrowHelper.ThrowArgumentOutOfRangeException (System.ExceptionArgument argument, System.ExceptionResource resource) (at <ad04dee02e7e4a85a1299c7ee81c79f6>:0)
System.ThrowHelper.ThrowArgumentOutOfRangeException () (at <ad04dee02e7e4a85a1299c7ee81c79f6>:0)
System.Collections.Generic.List`1[T].get_Item (System.Int32 index) (at <ad04dee02e7e4a85a1299c7ee81c79f6>:0)
UnityEditor.GameObjectTreeViewDataSource.GetItem (System.Int32 row) (at <a271a56180a643b0bef02438a8a1a5f9>:0)
Add comment
All about bugs
View bugs we have successfully reproduced, and vote for the bugs you want to see fixed most urgently.
Latest issues
- Decals are not projected when "Rendering Layers" are set to 24th Layer or above in Decal Projector
- Cancellation button is not centered and has no padding on the right side in the Background Tasks Window
- UI overlaps in the Project Browser window when resized vertically
- UI Elements overlap in the Search window when Search window is docked and resized horizontally
- ProBuilder Tool item appears twice in the overlay when editing in Vertex/Edge/Face context
Resolution Note:
Recording Undo during Awake() and OnEnable() is not supported.