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
- [Android] The Player freezes when disabling Bluetooth while connected to the headphones
- Addressable bundles are not retrieved from the cache when a WebGL Player is refreshed
- Sprites are incorrectly occluded by Sprite Physics Shape culling when behind in sorting order
- CPU usage is increased when the Editor is idle with the ProBuilder Package installed
- Unstable lighting when additional light sources are added in Shader Graph nodes
Add comment