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
- "Shader warning in 'Hidden/Light2D': implicit truncation of vector type" is thrown when building Universal 2D template
- AI Assistant breaks compilation of packages using System.Runtime.CompilerServices.Unsafe via auto-referencing
- Unity Hub checks the "Documentation" module by default on the 6.4 and 6.5 streams despite that it was unchecked with the previous installs
- Shortcut that toggles between Dopesheet and Curves Views in the Animation Window's Timeline is mislabed
- Property List Items Overlap onto the Property List's top edge when scrolling through a long Property List
Resolution Note:
Recording Undo during Awake() and OnEnable() is not supported.