I have some code which checks if an asset is present and if not downloads the respective assetbundle. Its taken me ages to get anything working as the documentation doesn’t have any clear examples so I’ve posted my solution below. However, when running this the download gets stuck at 1% and no progress is made, I assume it is just not downloaded it as it can’t find it at the url.
So, I’ve set up my addressables to make an assetbundle which is a remote build, it builts ok and then I upload it on FTP to my server. I’m using Filezilla in binary so it uploads ok. In the addressables window it is set up for the correct folder to look into.
So, I can’t see anywhere where I can actually get a check of exactly what url unity is going to to look for my asset bundle, is this available in debug anywhere? and where am I going wrong with this please?
THanks
Since addressables is a c# package, you should be able to open your project in an IDE, open Addressables code within that IDE, and set breakpoints. Or at the very least add Debug.Log statements. The file that (down)loads bundles is AssetBundleProvider.cs
no we went another route in the end - unfortunately like a lot of Unity stuff there is a lot of talk about the theory but I think there needs to be far more ‘cookbook’ stuff of examples of the code in useful ways. We did get the assetbundles to download but its been a while since we looked at the project and I assume the addressables package has moved on!
For the download being stuck at 1%, I had the same problem. Be aware that the PercentComplete property of an IAsyncOperation returns a float between 0 and 1, where at 1 the download is done.
Also with your Mathf.RoundToInt you’re going to print a 1 as soon as PercentComplete is >0.5.
I don’t know about your download problem, as far as I understand the ResourceManagement API I’d say your code should work, but be careful to log the correct values.