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
- Slightly transparent objects disappear completely in Web Player when using RenderGraph
- Visual Scripting Components are hidden behind a throbber when Multiplayer Play Mode is running with at least one local instance
- Video Player does not throw an error when playing a video with unsupported encoding settings
- Errors indicating that TMP Extras were not Imported logged when opening the Render Pipeline Converter Window while in Play Mode
- IL2CPP Player crash on VisualElement_get_hierarchy when calling VisualElement.Add in the Start() method
Resolution Note:
Recording Undo during Awake() and OnEnable() is not supported.