When downloading assetbundles using the following code from the unity docs, I receive an error.
while (!Caching.ready)
yield return null;
var www = [WWW.LoadFromCacheOrDownload(url](http://WWW.LoadFromCacheOrDownload(url), 0);
yield return www;
if (string.IsNullOrEmpty(www.error)) //string returns as null thus causes an error
{
Debug.Log(www.error);
// these two lines print the errors seen below
yield return www.error;
}
else
{
ContinueFromDownloadModels(www.assetBundle);
//Function that then loads assets from the bundle
}
The errors received are “Unable to move cache folder ‘C:/Users/name/AppData/LocalLow/Unity/WebPlayer/Cache/Temp/409646… etc’ to ‘C:/Users/name/AppData/LocalLow/Unity/WebPlayer/Cache/Name_Name/b6589fc6… etc’: destination exists”
and “You are trying to load data from a www stream which had the following error when downloading.
Couldn’t move cache data ‘C:/Users/name/AppData/LocalLow/Unity/WebPlayer/Cache/Temp/409646… etc’ into place ‘C:/Users/name/AppData/LocalLow/Unity/WebPlayer/Cache/Zendeavor_Zendeavor/b6589… etc’ when caching AssetBundle”. Both errors are the same, just worded differently.
I have tried this on a different PC to see if it was a error local to my machine but I receive the same thing, if anyone knows a fix I will be very grateful.
Thanks in advance.
Update: Turns out you cant have any assetbundles with the same name, which is what caused this error. If you also receive this error make sure all your assetbundles have unique names.