Search Issue Tracker
Won't Fix
Votes
0
Found in
5.3.1f1
Issue ID
788317
Regression
No
Undo.RecordObject is very slow for terrains
Edit before closing: Undo.RecordObject will perform a binary exact comparison between states of the object you are monitoring to find and record what changes are made to the object. In the case of TerrainData, which contains large arrays (e.g. the height map), this approach is rather inefficient. We suggest you use Undo.RegisterCompleteObjectUndo instead, which will only create a 'snapshot' of the TerrainData, and won't do the comparison. It's much faster.
Steps to reproduce:
1. Open attached project "788317.zip"
2. Open scene "repro"
3. In top menu, select "Window > Reset Terrain"
4. Notice that height of terrain is reset but Unity becomes unresponsive
5. Unity hangs for several minutes
Workaround: Use now obsolete Undo.RegisterUndo
Reproduced with: 5.1.4f1, 5.2.4f1, 5.3.4p3, 5.4.0b15
All about bugs
View bugs we have successfully reproduced, and vote for the bugs you want to see fixed most urgently.
Latest issues
- Joint Physics result in unexpected behaviors when used for articulated vehicles like buses or trucks
- Standalone Player crashes with "TDerived GetOrLoad<TDerived>() where TDerived : T" when IL2CPP Code generation is set to "Faster (smaller) Builds"
- IndexOutOfRangeException and InvalidOperationException when logging XML string
- Script missing in "Assets/Settings/Mobile_Renderer/GlobalVolumeFeature" of "com.unity.template.urp-blank" template
- “Font Asset Creator - Error Code [Invalid_File_Structure]…“ error is logged when generating Font Assets from fonts which worked with TMP Font Asset Creator
Add comment