Search Issue Tracker
By Design
By Design in 6000.5.X
Votes
0
Found in
6000.0.67f1
6000.3.8f1
6000.4.0b8
6000.5.0a7
Issue ID
UUM-134919
Regression
No
Asset remains in the project when attempting to delete it using "DestroyImmediate()"
How to reproduce:
1. Open the attached project “IN-134488”
2. In the menu bar, select “Tools/Test Asset Creator”
3. In the opened window, select “Create and Save Asset”
4. In the same window, select “Delete Asset with DestroyImmediate(asset, true)”
5. Observe the Assets folder in the Project window
Actual result: The asset remains in the project
Expected result: The asset is removed from the project
Reproducible with: 2023.1.0a3, 6000.0.68f1, 6000.3.9f1, 6000.4.0b9, 6000.5.0a7
Reproducible on: Windows 11
Not reproducible on: No other environments tested
Notes:
- Attempting to manually delete the asset immediately after reproduction step 4 prevents deletion and gives the following warning: “The operation "SoftDelete" cannot be executed because the selection is a root folder or an immutable asset.”
- After deletion, the asset appears empty in the Inspector
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
- Texture2D hash changes inside of an AssetBundle when rebuilding a SpriteAtlas bundle with an empty AssetPostprocessor Script enabled
- Aniso Level still applies when Generate MipMap is disabled in Texture Import Settings
- Mipmap Limit Groups long names are not truncated when creating a new Mipmap Limit Group with a long name
- “ArgumentException: Invalid double parameter.” error is thrown when Infinity is typed into the Fixed Timestep field
- GameObject becomes gray when using HDRP and STP together on macOS
Resolution Note:
DestroyImmediate with allowDestroyingAssets removes individual objects from the asset file but does not delete the asset file itself from disk, even when all objects have been removed. We acknowledge this isn't well-documented and will update the API documentation to make this behavior explicit.
If you need to also remove the empty asset file, you can use AssetDatabase.DeleteAsset() after destroying the objects.
Resolution Note (6000.5.X):
DestroyImmediate with allowDestroyingAssets removes individual objects from the asset file but does not delete the asset file itself from disk, even when all objects have been removed. We acknowledge this isn't well-documented and will update the API documentation to make this behavior explicit.
If you need to also remove the empty asset file, you can use AssetDatabase.DeleteAsset() after destroying the objects.