Search Issue Tracker
Creating Materials during OnRenderObject introduces asset database inconsistencies
When creating materials using OnRenderObject() function it creates two materials. Deleting them resolves in Unity crash.
1.Open users attached project
2.Open "Repro.unity" scene
3.Delete "BuggedMaterial" from Assets > Resources
4.Press Assets > Reimport All
5.Enter play mode
6.Press cancel for both errors
7.Ignore the last "Inconsistency Detected" error
8.Observe as two materials are created
9.Delete freshly created materials
Expected result: materials are deleted
Actual result: Unity crashes
Reproduced on: 5.5.2p2 5.6.0f3 5.6.0p2 2017.1.0b1
Notes: Using Update() or Start() functions, it creates only one material an deleting it does no crash Unity. Entering play mode with Unity 5.4.3f1, Unity crashes instantly
All about bugs
View bugs we have successfully reproduced, and vote for the bugs you want to see fixed most urgently.
- Variable is set to a different value from the selected enum value in the Editor dropdown
- TreeView Child display toggle styling becomes reversed when clicking and dragging it
- Null is returned when using FocusOutEvent.relatedTarget
- Unity_BaseInstanceID is always zero when rendering multiple meshes and instancing with the same buffer
- UI Document button's text does not resize relatively when size in percentage (%) is used
Resolution Note (2019.1.X):
We really appreciate your contribution to the Unity product. Thank you for reporting this issue. We take every case submitted to us seriously by investigating the impact on you, our customer, as well as the impact it may have on the engineering and experience of our product.
This particular case has been investigated thoroughly and we have decided, in the interests of protecting the stability and features of Unity for users that rely upon the affected versions, to not address this fix for the time being. We understand that this will cause problems for some users, and so may address in a future version.
Unity QA Team