Search Issue Tracker
By Design
Votes
0
Found in
2018.4
2019.2.6f1
2020.1
Issue ID
1195349
Regression
No
The new path is relative to asset path when calling AssetDatabase.RenameAsset(string path, string newPath)
How to reproduce:
1. Open the "repro.zip" project
2. Open the "SampleScene" scene
3. Enter Play Mode
4. Check the console:
- Notice that the new path is added to the existing path.
Actual result: AssetDatabase.RenameAsset tries to rename the asset with new path relative to the current path.
Expected result: AssetDatabase.RenameAsset renames the asset with new path.
Reproducible with: 2020.1.0a14, 2019.3.0b11, 2019.2.13f1, 2018.4.13f1, 2017.4.35f1.
Notes:
- According to https://docs.unity3d.com/ScriptReference/AssetDatabase.RenameAsset.html all paths should be relevant to the project folder.
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
- Crash on D3D12CommonShader::ApplyGpuProgram when attaching material which samples "_UnityFBInput0" to "Full Screen Pass Renderer Feature" Component
- SpeedTree meshes and objects count differs when comparing the numbers in the Player with the Editor
- Model and Prefab Preview icons are not updated after upgrading associated Materials to URP
- Game view is rendered white when viewing the Editor with HDR display and Post Proccesing is enabled on the Main Camera with 2D URP
- UI Builder doesn't update the style sheet when using "Extract inline style" right-click option
Resolution Note (2020.1.X):
AssetDatabase.RenameAsset takes relative path and thats by design. Maybe not the best one but we cannot change the behaviour right now.
use AssetDatabase.MoveAsset if want to move to absolute path or relative to project folder path.