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
- Out-of-bounds memory access with multiple CanvasRenderers under a Canvas when using Mesh API
- Inspector tries to access file after it was deleted when the file was locked in Inspector window
- Changing Transform values in Search window Inspector loses focus while dragging and stopping mouse without releasing dragging action
- Saving changes on the dirty VFX Graph during the Play mode throws "The referenced script (Unknown) on this Behaviour is missing!" warnings
- VFX Graph Debug Info overlaps the "Initialize" block debug info by default
Resolution Note:
Recording Undo during Awake() and OnEnable() is not supported.