#📦┃addressables
1 messages · Page 7 of 1
I don't load them all at once. One at a time for each level so I don't know how many they are at the start of the game.
Yea so thats why i suggested loading asset locations via a tag...
Oh, you mean by using LoadResourceLocationsAsync ? All the files must have a label then ?
Is it possible to create a file and give it a label in code by addressable ? Because I don't want it to be done manually.
Addressable entries can be modified with code in edit mode
Use this to get the default settings object to then add/modify asset entries
https://docs.unity3d.com/Packages/com.unity.addressables@2.7/api/UnityEditor.AddressableAssets.AddressableAssetSettingsDefaultObject.Settings.html
Awesome, thank you very much.
How can i solve issue that my Occlusion Culling (built-in unity system) is not loaded correctly for a scene loaded from Addressables group?
Scene is loaded as that
Addressables.LoadSceneAsync (sceneAsset, LoadSceneMode.Single, true);
Unity 2022.3.5f / Addressables 1.21.12 / Android
Edit: I managed to find this issue https://issuetracker.unity3d.com/issues/android-ios-il2cpp-occlusion-culling-does-not-work-on-android-when-a-scene-is-loaded-with-addressables-dot-loadsceneasync-on-a-il2cpp-arm64-build, but it's hard to believe for me that Occlusion doesn't work "By design" for Addressable scenes
Asset bundles have many dumb issues
im a bit unclear about how addressable groups bundle the asset and the theory behind it
So, for like, an rpg, should i put the assets of each location (Village A, Village B,...) into a seperate group ?
I asked chatgpt before and it said something about it should be bundled by...update frequency?
You want to put assets that will be loaded together in the same group
Grouping by scene/map/location is smart.
You may want to consider update frequency if the group is remotely hosted
what if i have like 100 locations ? Would that turns into 100 bundles ?
Yea, then less bundles can be loaded at once
is there any drawback to having that many groups ?
I feel like this can spiral into hundreds of groups
Shouldnt be any downsides, check the addressables docs to see if they mention anything (dont ask ai)
thanks!
Hey everyone, I’m running into a weird Addressables issue and would love some insights.
I built Addressables twice (Build Remote Catalog = false) and got two different problems:
At 1st build:
Bundling Name Mode = Hash
I uploaded all bundles from ServerData to the server, then built the APK.
- On device, LoadAssetAsync failed with 404.
- After checking, the bundle filenames requested by the APK had different hash suffixes compared to the files in ServerData.
At 2nd build: - Switched Bundling Name Mode to Filename.
- Then requests from the APK returned 200 OK, but loading failed with CRC mismatch.
Extra context: My level prefabs are in a separate folder and are ONLY referenced in one config file (List<AssetReference>). That config file is inside an encrypted folder in our CI/CD pipeline. During build, this folder is processed and built into a separate AssetBundle.
I’m wondering if this encryption / extra AssetBundle build step might be triggering another AssetBundle build or modifying the content, causing the catalog and bundles to go out of sync?
Has anyone seen something like this, or knows how Addressables behaves in this kind of pipeline?
All assets need to be loaded when the addressable is loaded. If you leave them out then the scene will have the object but not the texture
someone told me this. What did they mean by this ?
If the catalog and remote bundles are rebuilt later by a different clone of the project then the two issues you mention can happen
- The failing CRC check can be solved by disabling this check for local groups
- The filenames not matching can be solved by what you already tried, changing the bundle name mode to not append hashes.
I think the hashes are derrived from the "project name" which is just the name of the folder the project is within.
I have encountered both problems myself and solved them this way because we had a different project clone that could rebuild and upload bundles
no idea I cant understand it myself
Thanks, I’ll try disabling the CRC check and see how it goes. However, I’m still confused about the first issue (the different bundle names) . According to Unity docs, the bundle hash is calculated from the bundle contents, so I don’t really understand why the bundle name/hash would change after the build.
Maybe I’m missing something here, but at the moment I have no clear explanation for that part. 
i checked the src ages ago and discovered some very odd logic for these but that may have changed since then
Our bundle organisation for remote bundles meant we could just use group name only
i was working with addressable-loaded scenes
so im a bit confused with the difference between it and normal scene
something like this
An addressable scene will have dependencies (e.g. mesh, texture). These will be added to the group automatically if not already addressable.
These dependencies get loaded when the scene is loaded
that person is mistaken
thanks!
so if i use only direct references in that scene, i only need to care about loading and unload the scene only, yeah?
Yes
It works the same for all "assets"
If an asset depends on another asset then that is automatically handled.
If the other asset is not marked as addressable (and thus in a group) then it can get duplicated in many bundles. Use the analysis tool to find these.
Oh, I just noticed the builds were done with different Unity versions. 
Is there any proper way to fix Addressables issues caused by this, or do we need to lock everything to the same Unity version?
Use the same unity version. How an asset is compiled or processed could change.
I dont see how you managed this unless you have addressables in another project and you merge in the catalog.
public class CharacterDatabase : ScriptableObject
{
[SerializeField]
private List<CharacterDefinition> characters = new();
private Dictionary<string, CharacterDefinition> _lookup;
Something like this is extremely horrible for memory right ?
Since every character definition is loaded into memory the moment i touch CharacterDatabase?
If i use pack seperately like this, the whole Sylphy folder will be in one bundle, right?
Is doing it like this cool ?
That is my understanding (and a place where it could make sense to use addressable asset references that you load when you actually need them)
in fact, I have a "character catalog" just like you do :p
I haven't actually tried to do this yet, however
Is there a risk if i package my assets into too many bundles ? Like one-off illustrations that are used in dialogue, or items, one-off vfxs,... I dont feel like they're tied to anything to pack together, so im planning to pack every single on of them seperately. They will be easier to manage this way too
Hey. Loading an AudioClip via addressables then assigning it to an AudioSource's .resource or .clip property wont play the audioclip, instead the audiosource stops playing. Anybody knows something about this?
Did you assign the new clip and then call Play() again? Also make sure you arent releasing the asset while you are trying to use it.
I did not call Play() on it, maybe that was the problem. I will check later
{
Debug.Log("testing 1 " + slotKey + " || " + handle);
if (handle.IsValid())
{
var bootstrap = SceneManager.GetSceneByName("Bootstrap");
SceneManager.SetActiveScene(bootstrap);
Debug.Log("testing 2" + slotKey + " || " + handle);
var unloadHandle = Addressables.UnloadSceneAsync(handle);
while (!unloadHandle.IsDone)
yield return null;
Debug.Log("testing 3");
if (unloadHandle.Status != AsyncOperationStatus.Succeeded)
{
Debug.LogError(
$"Failed to unload Addressables scene for slot '{slotKey}'.\n" +
unloadHandle.OperationException);
}
}
loadedHandlesBySlot.Remove(slotKey);
Debug.Log("testing 4");```
i am having problems unloading a scene from addressables. loading it is fine, but when i try the above code, only up til "testing 2" prints and nothing else. its just stuck there. any ideas why?
so i tried including it in the build scenes setting, it still does the same thing in my AsyncOperation unloadOp = SceneManager.UnloadSceneAsync(sceneName);
it just stops there
it's supposed to load another scene additively right after that
Use a debugger to see if it gets past the while loop
I would also recommend async instead of coroutines so you can simply await any load/unload
i tried to recreate another project to find out what was happening, and now i get an "attempting to use an invalid operation handle" . when i log unloadHandle.ToString() it shows this: UnityEngine.ResourceManagement.AsyncOperations.AsyncOperationHandle`1[[UnityEngine.ResourceManagement.ResourceProviders.SceneInstance, Unity.ResourceManager, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null]], then the next thing that happens is the error is thrown
while (!unloadHandle.IsDone)
yield return null;
Debug.Log(unloadHandle.ToString());
if (unloadHandle.Status != AsyncOperationStatus.Succeeded)
{
Debug.LogError(
$"Failed to unload Addressables scene for slot '{slotKey}'.\n" +
unloadHandle.OperationException);
}
}```
i finally managed to find a fix, but i still have no idea what is happening. in the above code, if i commented out the whole block of while (!unloadHandle.IsDone) yield return null; Debug.Log(unloadHandle.ToString()); if (unloadHandle.Status != AsyncOperationStatus.Succeeded) { Debug.LogError( $"Failed to unload Addressables scene for slot '{slotKey}'.\n" + unloadHandle.OperationException); } the scene finishes unloading and proceeds to other instructions beyond this block as per normal.
i suspect unloadHandle, for some reason, becomes null when it returns from Addressables.UnloadSceneAsync(handle) as i am getting "attempting to use an invalid operation handle" error when the code hits while (!unloadHandle.IsDone)
are there any explanations for this?
handles are structs so cannot be null.
must be that the handle was already used up
are addressables included in the build
and what exactly are they
i've tried reading things and it's still unclear
Local groups mean those assets are in an asset bundle thats included in a build. Asset bundles are still used but its the location of the bundle thats different
i have to look up asset management more lol
i'm trying to get my first addressables to work
you can use .ToUniTask() to convert the async operations to tasks which you can then await with WhenAll.
also wtf are you doing with asset paths this will only work in editor
You have miss understood some critical things
where?
i don't see asset paths in my code
i am tryig to see if i missed a .asset
maybe that will only be editer stuff
it's also just the file name that it's passing to the addressables
If this is editor code you dont want to use addressables
If this is runtime code then you need to do this compleatly differently
this can run on another thread
ItemSO someItem = await Addressables.LoadAssetAsync<ItemSO>("MyItemAddress");
no most unity apis refuse to work on other threads
It will throw an exception explicitly stating that fact
then why even use "Load ASYNC"?
if it's just gonna give an error for being on another thread
Async does not automatically mean other threads
oh
the loading work may use other threads internally but we dont have to worry about it
we just want to load something and wait for it to be done at some point in the future
async code makes that a lot nicer to write
so how would i do this correctly then? I am just tryig to load scriptable objects by addressables
JS promises are the same, im sure you know JS has no threading without workers right?
no, i always assumed it used another thread to do it or something
It can but it depends on whatever async thing we call and that is the case in all languages with async
you mentioned somethign about only working i the editor, can't you use system.io for all files in the data or persistentdata paths?
just did this i guess
You are using data path to construct asset paths which is just wrong.
Your assets folder doesn't exist in a build.
This tells me you just miss understand how to use addressable addresses
Use a label to load these definitions in one go please
I wont repeat this again go read the doc pages and learn properly how to do this work
trying not to write 50 lines of code
but idk
addressables are so freaking hard
wait
the types are the same
wait... IList vs List, what is an IList?
it's empty
i think it's half working, but it's still getting empties
location.ResourceType returns "ItemSO" but location.Data is null
location.PrimaryKey has the keys of the ItemSOs but why is the data empty?
this works now
You can use the I resource location object as the argument. The docs state this
Google it. It's an interface that List, Array or other collections can implement.
C# docs are good so go use them
oh nice
Hi there, I managed to get a working build script that would convert all my addressable scenes content to a single addressable prefab. By doing so they can be bundled with my regular content and avoid duplication (as Addressable splits scenes and other assets).
What I don't know how to do is actually to reverse the changes after build. I'm not sure I'm doing the correct thing by modifying the assets in the first place. I'd rather having the new assets in some sort of build temp/cache, not sure it's feasible. Otherwise I'll duplicate the modified asset in Temp first and restore them after the build.
I'm asking there as I'm also wondering if people devised some solution of their own and what they do think of this one.
(The forum link)
https://discussions.unity.com/t/how-to-handle-addressable-duplication-for-hybrid-scene-objects-asset-reference-patterns/1704264/11
Scenes just contain serialized data and gameobjects so what you are doing shouldnt matter when talking about "asset duplication"
Anyway if this is build automation you could make use of source control and discard the changes but making copies of the assets and the addressable entries is also fine
Thanks, not sure of what you meant on the addressable topic ? You can see assets duplication warning in the addressable report for regular scene vs modified ones. Do you mean I shouldn't care for it ?
The solution to any asset duplication is make those dependencies addressable so they are put in a group
the auto fix just does this too
Yes indeed, the reasons I don't want to pin point duplicated deps are explained in the thread (too diverse)
the solution is when these new assets are made... make them addressable
If the artists always forget then make the folder addressable
then all sub assets are addressable too and bam problem solved
On new projects we woulnd't have the issue. This one was dragged around and the structure won't allow for a clean fix. But yes
Or invest in automating making assets addressable and organising this instead
I could, and probably would, but I wanted a minimal effort fix in this project situation.
What you descibe sounds a lot worse and i should point out that prefabs are not the same as scenes so this isnt a perfect solution
It's not perfect by any mean
really its not hard to get asset dependencies, check what has addressable entries or not and correct this
When the cast is about 1000 elements scattered then it's ugly in both case. It would need several days to dig around.
Why the link to the API ?
i wonder anyway goodluck
I will certainly need some. Thanks
Hi everyone, I am making a prototype with unity's addressables
My addressable build is successful, but I keep getting error 400 during the upload stage of the CCD management package, (I tried it before Christmas as that part worked)
but now, I get error 400. I feel like the issue is this button: Enable CCD features
I am unable to enable this button, and I do not get an error in my console or in Editor.log
I am searching everywhere online, but I could not find anything usefull
I am using unity 6.3 LTS and addressables 2.7.6
both have been updated since the uploading worked before Christmas
could that have caused the issue? Thank you
Since you updated both versions recently, that Error 400 + disabled button usually means your Project ID handshake got desynced.
Try this:
Go to Project Settings > Services.
Unlink and then Re-link your Project ID.
That usually forces a token refresh and unlocks the "Enable CCD" button. If that doesn't work, log into the Unity Cloud Dashboard on the web and double-check that your target Bucket actually exists (sometimes updates reset the default routing).
You are meant to use its address to load it via Addressables.LoadAssetAsync()
the point of addressables is to not work directly with asset bundles
So I've tried this multiple times, I've checked my buckts multiple times aswell, but it does not solve my problem
I am 100% sure all my paths are correct
I still cant enable the button
this is the exact error I am receiving:
System.Exception: Unable to create entry for client-default_assets_all_64b626a863a306a13f047e4a2a386dd6.bundle: Bad Request. Unity.Services.Ccd.Management.Http.JsonObject ---> Unity.Services.Ccd.Management.CcdManagementValidationException: Bad Request. Unity.Services.Ccd.Management.Http.JsonObject ---> Unity.Services.Ccd.Management.Http.HttpException`1[Unity.Services.Ccd.Management.Models.ValidationError]: (400) HTTP/1.1 400 Bad Request
Or sometimes I get the error not targetiong CCD
I am now going to try to downgrade my package
Here are all my settings, anyone sees something peculiar? Thank you all for the response :)
I do have the correct permissions as well, as I can create/delete buckets and view what is in there on the Unity DevOps website
So I just get the asset I want via name and not worry about the bundle itself?
Ill be extra clear, you use its address which can be ANYTHING and does not have to be the assets name.
You load an asset with its address and do not worry about its group/bundle.
Ok I understand
If I await this asset, my Sprite must be a void... but i can't do a void. What can I do here?
ok maybe async UniTask<Sprite> might work
i'm just going to property assign these.
Sorry awaiting the load directly is an extension from UniTask.
Using the .ToUniTask() extension is also valid
If using asm Def's add the UniTask addressables one to references
Has anyone ever encountered a situation where when releasing references to assets and those assets bundles being unloaded somehow unloaded assets which were neither addressable, or shared references to addressable bundle dependencies? I have some references to assets in scenes which have no connection to addressables and yet if I release my addressables to the point their bundles unload scenes lose references to assets.
If I stop releasing the addressable references, the asset references in the scenes aren't lost.
I'm exceptionally confused about the cause.
I've tried to track down any way in which the assets referenced in these scenes could be part of an addressable bundle dependency chain which would cause them to be part of a bundle which is being unloaded, but I can't find a cause.
If the addressable scene is not released too early this would prevent this
Should work the same for all asset dependencies, if all users are released the dep can be too
The scene isn't addressable.
Then it has 0 addressable dependencies. Do you use AssetReference in this scene then or load stuff manually?
As far as directly part of the scene I don't think so, but I haven't completely verified. It's only been a couple specific assets in the scene which exhibit this behavior.
To summarize: There shouldn't be AssetReferences in the scene asset itself (but I have to verify - I'm not the only one who works on them), the assets which are being unloaded aren't addressable nor do they have any shared dependencies with any addressables, the scene isn't addressable.
The scenes are loaded via SceneManager.LoadSceneAsync.
Addressables are loaded manually at runtime in various places.
Then if these assets are all manually loaded you must be releasing them too early.
I asked about the scene to find out more about whats happening. AssetReference just stores an address for you to load manually later.
I'm sure I'm missing something. Understanding how assets which aren't related to addressables end up unloaded is perplexing though.
Addressable assets + their deps ALL get stored in asset bundles so they cannot affect other assets
Its the quirk/flaw of it using asset bundles
Yeah that's my understanding.
Make a content build and use the profiler to see asset loads + ref counts and when things get unloaded
Hopefully you are on unity 2022 or later
All I know is there are prefabs referenced within the scene (normal serialized field references) which if I release addressables end up being lost when later reloading those scenes. But only if I release addressables.
So I'm trying to understand if there are hidden quirks such as dependency chains relationships which could pull the assets into bundles.
But it would seem very confusing if that were a hidden behavior.
That cant be true. Scenes in your normal scene build list would have all their dependencies in build. There cannot be any crossover
Remember that if you destroy textures while in use that causes issues regardless of where they are loaded from
Use the profiler to better see what you unload when with addressables
Appreciate your input, and providing a sanity check.
Ive delt with lots of addressable related bullshit so happy to share some knowledge 😆
One day perhaps asset bundles will get the love they deserve
Same. This has taken be by surprise though since in theory nothing involved is addressable.
I walked away to take a break during work yesterday shaking my head and thinking "The addressable system is actually broken", but I presume it's some very strange quirk of usage or something I'm overlooking.
My error, no doubt.
If you build content and change the play mode method to use those bundles you can probably tell if assets are from bundles or not based on if you can get their asset path via Asset Database
You can also access addressable settings in editor and get addressable entries
Yeah I ran a runtime query against the catalog checking for the asset GUID to see if they were in referenced and it returned no matches. Was right before the walking away and shaking the head, lol.
that helps!
<@&502884371011731486>
can I set an AssetReferenceGameObject in code or do I have to drag in the prefab in the editor for each?
so if you want to automate this you can
I'm making a SO for each character like cs public class charnameConfig : ScriptableObject { public AssetReferenceGameObject prefab; public int maxHealth = 100; public string displayName = "charname"; }
and I'm trying to preset the prefab variable
pre set? you mean set this in editor?
I mean I basically want to hardcode it since the SO is readonly and the game spawns the prefab from that
or is supposed to, anyway
Are you confused? you will just make some charnameConfig assets in your project somewhere, assign the prefab and thats it
I said that we should treat scriptable objects as read only because changes made to one in play mode will be kept
which is not something that happens in builds (so some people get confused thinking it can be used to save data)
didn't you tell me to have an SO with the data for each character so I can load the SOs into a dictionary to match them with the ID I pass from selection?
Yes i did.
Go read this and hopefully it will make a lot more sense how this all goes together: https://docs.unity3d.com/6000.3/Documentation/Manual/class-ScriptableObject.html
Yes, but don't I also store the asset reference in the SO?
Yes that part is correct too
ok and how do I set the asset reference?
Are you understanding that scriptable objects are a way for us to have our own assets to store data we want in a project?
Add the [CreateAssetMenu] attribute to the class, make a new asset in your project from the Create menu and see how you can configure this stuff just like a Monobehaviour on a gameobject
@wicked prairie plz read and try. if you want more responses from me then reply so i get notified
I see how you mean. But then do I have to drag in the prefab asset in the editor or can I set it in the code?
that's what my question was
Why would you set this in code? Do you want to do this at runtime?
The point would be to make the assets and assign the data and then you just use the assets as is
I understand, thank you.
Hey everyone,
I ran into a weird issue with Addressables. When I build them, my 3D prefabs become completely invisible. I’ve checked that the Renderer is enabled, the Material and Shader are not null (I logged them and they’re valid). I even tried checking if the Shader is null, then using Shader.Find and assigning it back. Any objects using the same Material in the static scene render just fine. I’ve tried different Materials and Shaders on my prefab, but they all become invisible after loading via Addressables.
The prefab still has working colliders,I can access each mesh vertex,but it just doesn’t render.
Does anyone know why this might happen or how to fix it?
<@&502884371011731486>
Are the bundles that are loaded for the correct platform? I know from experience that android bundles can be loaded on windows editor but shaders are non functional (and are fixed with a re assign as that swaps it back to the correct one for win)
Is it advisable to preload all of your addressables that you will need in a level?
It depends because you will be loading them all into memory.
You can ensure they are downloaded beforehand with other methods
I'm having an issue where some of my addressable assets refuse to be added to asset bundles. I have a set of 2048x2048 png textures to be used as part of a tutorial. Each one is about 2Mb.
Here you can see them part of the tutorial group
In the addressables report, the entire group is 4Kb, and if I try to load the image in-game the addressable system says it doesn't exist.
There are only ever referenced from code by their label, so I'm wondering if the addressables build is deciding not to include them because it can't find references to them from a scene/prefab, but I can't find anything similar to that in the documentation.
This is Unity 6.0.59f2, and addressables 2.7.3
The bundle does contain the files, but they're all zero size.
That isnt how that works, whatever is in a group is included in a bundle. What are the group settings?
What unity version is this? They look fine to me
Try clearing the past clear data + cache and do a new full build now
Unity 6.0.59f2, and addressables 2.7.3
you may be able to update the package btw
Clean cache no change. I'm always a bit wary of speculative package updates but I'll give it a go.
No change.
What if you make a new local group and move them there?
Deleted the group, created a new one with default settings, and added the images to that. No change.
Yep, that 🙂
Hmm my only other suggestion is to close unity and delete Library/com.unity.addressables
Build automation I used to use always deleted this otherwise some addressable changes just never took effect
Didn't help I'm afraid. I did try dropping a random png into the same folder and adding it to the asset bundle and that works fine. So there's something odd about those png files? We can't add things with a texture type of sprite to asset bundles? Something weird in a custom asset importer?
Changing it to a sprite texture type breaks it. So for some reason we can't have sprites in an asset bundle.
Update - we can't have sprites with a sprite mode of "multiple" in an asset bundle. Sprite mode of "single" works.
And I think that's where I stop. Works for me etc.
They do work I use them a lot. The top main asset is added and the sub sprites show in a dropdown.
You access them via mainaddress[spritename]
Are you somehow adding the sub assets instead of the main sprite asset? @warm lynx
Your UI does not have the expand arrow so something is surely wrong
In this image _01 is set to a sprite mode of multiple and _02 is set to single
no other differences
And does that multiple sprite have sprite assets inside it when you expand it in the assets window?
What is the best way to organize assets in your project such that you can make sure assets that are loaded together are in the same asset bundle. Do it by folder structure?
That is only true if you make the whole folder addressable
Otherwise its up to you to organise them well
im so confused about shaders. Do they bundle or not? I am in a brand new project, nothing in here except my assetBundle loader script. I am inconsistently getting and not getting shaders when i import the same bundle repeatedly as a test
and yeah i know i already asked about this a while back, but this is slightly different. Last time I was asking about URP shaders specifically, which cant be added to shader variants and cant be added to always include.
However this time i am only asking about custom shaders.
ChatGPT says id have to include it in the app, is that true? It cant be because i have bundled new shaders in a separate project in the past and had them load, just not sure what the specific rules are for it
hm.... Ok, I suspect this is at least relevant. I am testing on PC, but because I have my editor set to iOS platform, it made sense to me that I should import the iOS bundles, and yeah I had been getting Pink
but even though my editor's platform is set to iOS, looks like I actually get correct results simply importing the Windows bundles
so im assuming if i test this on device, i probably wont have problems afterall, my issue seems to have simply been wrong bundle for the hardware..... would love to hear from someone knowledgable on this specific thing
Yes you must be using the correct bundles for that platform. Make sure addressables get built and separated by platform (especially if hosting stuff online)
Addressables handles the shader stuff and should have a bundle for shaders
oh we are only using assetBundles
what is main difference between assetBundle and addressable? I tried reading up but only became more confused.
What I tihnk I understood is that Addressables are a layer of management above the also-contained assetBundle?
Yes it uses asset bundles but provides an easy way to load assets and also handle dependencies. It also supports remote bundles that can be downloaded on demand/ahead of time and versioning.
I see almost no reason to use asset bundles raw unless its some mod stuff (even then you can "merge in" other catalogs at runtime)
Interesting. I'll try
Is it possible to bundle a scene with baked lighting?
Yea just add the scene as normal and that should work automatically
good to know, thanks a bunch
Hello anytime myself or one of my team members tries to open a prefab in unity in crashes, I'm assuming its a memory leak but Im not sure what the cause is.
editor or runtime? does this actually relate to addressables or you picked a random channel?
not ranomd per sa but the description mentioned asset management? is there a more appropriate channel? Also this in the editor. Any prefab you try to open Unity just crashes
read the desc again and see your mistake but whatever ask in unity talk
How do I know if a content package from Remote has been downloaded and will not redownload it? Let's say for Android Release Build.
You can request the download size for the asset or label and if it's 0 then you know
Using GetDownloadSizeAsync right?
Yes
What about in WebGL, I tried using it but GetDownloadSize always not zero even if it's built-in streaming assets.
Probably expected until the assets have been loaded as nothing is local on web
AHhh Yeah, I realize that, Server and Client in Web Dev setup confused me
I'm not sure how to explain it
But, which issues can be about the Asset cannot be find in the project?
I have the files in the Addressables list, with specified address name and Labels, but I cannot read then :/
Share the code for how you are trying to load them
That's an issue, because I'm trying to do it using an asset, but the asset developer don't says nothing about to help
I'm completing blind about it :/
What asset? It depends then on how this is configured. Is it an address or an asset reference?
Naninovel asset
Hmm do they manage this for you or how does it work? Can you give an example or screenshot as to how loading works with addressables enabled?
That's a big issue
I have the link with the documentation, this will helps?
I'm studying, reading, trying to get more infos, but I'm complete lost about this system with addressables
I don't know event where to start
Each topic, info, tutorial that I find tell in a different way
I'm very, very confuse about it
From what im reading it may just be that you have the option to store assets via addressables and as long as you link them up it works as normal? Can i ask why you are trying to use addressables vs say Resources?
Because the files will only be in the game as DLC
So, once the game is builded, the characters files will be downloaded later
And resources isn't accessible anymore once the game is builded, because is inside the ProjectSettings
assets in a Resources/ folder are always accessable
the project settings for this tool is likelly a scriptable object in project somewhere too
Anyway I cant really tell from the docs how tf you setup an asset thats in addresables vs elsewhere. Check the docs for addressables to learn how you load assets from it normally
https://docs.unity3d.com/Packages/com.unity.addressables@2.9/manual/load-assets.html#load-a-single-asset
Maybe that will help i dunno. Ive used addressables a lot so I can help with that but not this other tool
I read already
I tried everything that I found in the internet to understand it :/
Oh i see now. The tool is putting the assets into addressable groups for you. Therefore you should use the option that puts them in different groups by category (then you can configure some groups to be externally loaded)
As in addressables we can configure per group its load location (in build or outside the build or even online at a URL)
By context, I'm using Ultimate DLC Toolkit
This works to retrieve every files, it works, no problems about it
I can set the files inside the game
But my problem is to read this files, because to read need to be inside the ProjectSettings or as Addressables, and I'm very very very confuse about it
I cannot send the video here, but, can I send in your PM?
You need to understand how to use addressables yourself then because thats crutial to actually do this properly
If i understand their docs better than you then you would just configure this ahead of time or make the addresses match the format they state for them to get loaded anyway.
https://naninovel.com/guide/resource-providers.html#manual-assignment
It must try to find load something with an address like this and if you give things the address it expects then it works
I tried
I tried everything in the documentation
I tried even talk with naninovel developer, but the guy is useless
Only send links and don't explains/helps nothing
And I become completely blind to this issue
You are trying to shove together 2 things without understanding how it could even work
No, I was studying about Addressables, and I created the group
so do these work?
Not
And I don't know why because Console Log only says that the file isn't available
And this error don't says to much
Looks like it should based on the doc list 🤔
Are you sure addressable support is enabled? What are the settings for this addressable group?
Also make sure "play mode script" was not changed
There not to much to config
Addressables sould be in auto mode
You can maybe try moving em to the default group as that should be configured correctly already
I tried too
You can try loading the asset via addressables manually to sanity check
but im out of ideas after this point
A question:
This files, how can I retrieve once I created the bundle?
VIA ADDRESSABLES
you do not need to build in editor
to get these assets at runtime you load them via the addressables api go read it
i need to upload some unity assets to blender and everything is saying i need to export them as fbx or obj but im not sure how to do this, could someone help me figure it out?
If you already have a glb file then just import that in blender?
go find the file in windows file explorer
also wrong channel no idea why you picked this one
i wasnt sure which channel to use because i dont really know any of the terms sorry
i already tried importing it but i kept getting a popup and it wouldnt work for some reason
well blender supports glb and gltf files and perhaps reading the error/info would help 😐
ask in the blender server for help with blender
I'm confuse again :/
In the unity editor we do not need to build addressable content into asset bundles for it to work (unless you changed the mode to "Use existing bundles")
This is explained in the addressable docs which i would reallllly like you to read a bit
I am confused why I can't use AudioMixer normally with addressable, and I have to switch them in run time in the scene. Because Addressable creates a copy of Audio Mixer. Now every Audio Mixer I have set in the inspector of an Addressable prefab, needs to set to it's original Audio Mixer instead of it's addressable clone...
This is an issue with addressables as a whole. Asset bundles cannot reference things not in that or other bundles. Thats why it duplicates stuff.
Somehow unity have failed to correct this crucial flaw.
The best solution for me in the past was to have everything in addressables
i basically ditched Resources
But that doesn't solve it. Does the mixer needs to be in addressable as well and then you can use it in inspector?
As long as the assets that use it are also addressable so then they all reference the same one
Otherwise yes you will have to overcome the issue by locating the asset to not duplicate
Again I have no idea why unity made this design decision. Seems fine to me to allow build to/from bundle references
i have a strange issue with my assetBundles, pc and iOS bundles are fine, android bundles, built from the same prefab with platform overrides set, is appearing with a strange grey haze over it, loading a test bundle and removing its normal map gives a correct appearance, sans normal map.
what's weirder is i am importing these same bundles to a separate project without this glitch
I have two animator controllers in a folder of addressable. The second one was cloned from the first one. They both suppose to have one paramter. But the second one appears as if it has 0 parameters. Only if I do "fast" like ignoring the adderrssable, the second controller parameter appears.
I am now trying to install newer editor version, and now everything in library and obj is not compiling. So I am doing a new build which will probably take a few hours.
Is tha how you solve these things?
I mean I had to delete library and obj
Sometimes you do need to clean old addressable data (either via the addressable build menu or deleting Library/com.unity.addressables)
I get endless errors with Unity latest version(not beta), it as if the packages have errors, and deleting library didn't help
All packages are up to date
Can you share these errors?
There was an issue with a single skybox CS file, that did:
[SupportedOnRenderPipeline(typeof(UniversalRenderPipeline))]
Changing it to
[SupportedOnRenderPipeline(typeof(UniversalRenderPipelineAsset))]
Fixed all the errors
Like from a 3rd party sky box asset
Hi,
I’m using the Addressables system and have a group (e.g. level JSON assets) whose entries I’d like to adjust right before a player build.
Question: Is it supported (or safe) to programmatically change the serialized entry list on an AddressableAssetGroup — effectively what shows up as m_SerializeEntries in the asset — during IPreprocessBuildWithReport.OnPreprocessBuild (or another build preprocess callback)?
I think as long as you save your changes and it happens before addressables builds content it would work fine
Is there a way to have addressables ignore a dependency file? This editor shader FallbackError.shader from the shadergraph package keeps showing up as duplicated. I don't want it in my bundles at all.
Its probably not something you can avoid as its needed for if the shader cannot be used on some platform.
Just put it into the default group to stop this.
If its a dep at bundle build time then thats that
How can I mark it as Addressable? It doesn't show the addressable checkbox in the inspector. Maybe because it's in a resources folder or as part of a package?
I think it might be because its inside of the shadergraph package editor folder. But why is an editor file being pulled into an asset bundle?
We can view assets in packages, do you have them hidden? Do that then drag it into a group
I can see the file in the inspector, just no option for marking addressable and dragging into a Group doesn't work either
Pretty sure because it's in an editor folder because if you just make an editor folder and put something in there, it won't let you make it addressable. But it will happily put dependencies that are in the editor folder into a bundle.
Oh it may be because it's in a Resources folder and it can't move it out. Amazing illustration of how shit asset bundles can be soo glad they picked them for this /s
Seems like its only an editor restriction because I was able to manually add it to the .asset of my group in a text editor. 
Do confirm you can still build your content!
Can someone help me with json catalogs?
I am implementing a mod system that allows modders to provide their own addressables. I am (currently) not using any addressables in my base game.
My mod sdk builds the mod as a folder structure that contains an assemblies folder with dlls and a content folder with .bundles files that are built by the addressable system and include a catalog.hash and a catalog.json file (currently, my test mod has two .bundle's: [...]_monoscripts_[...].bundle and defaultlocalgroup_assets_all_[...].bundle.
In my base game, I have the addressables set up, set the AddressableAssetSettings Build Remote Catalog to true, aswell as Enable Json Catalog.
If I then use Build -> Default Build Script, it also builds a catalog.json in the project library folder. That catalog json file is also in the final build in the streaming assets path.
If I then load a content catalog from one of my mods using AsyncOperationHandle<IResourceLocator> handle = Addressables.LoadContentCatalogAsync(catalogPath, false);, I get this error:
System.Exception: Expecting to load catalogs in binary format but the catalog provided is in .json format. To load it enable Addressable Asset Settings > Catalog > Enable Json Catalog.
(yes, I can see from the stack trace that this is the code that triggers it)
How is my project refusing to read the json catalog? It's telling me to enable Enable Json Catalog in my Addressable Asset Settings, but that's literally what I've done.
I feel like I have tried everything. I restarted unity countless times, I cleared the build cache from the addressable groups window and ran the Default Build Script, then Clean Built the entire project, but the addressables system refuses to load the json catalog.
Im not sure if it will help but your internal catalog should not be external like this. Some user mod catalog + bundles should be separate and different.
These are meant to be additional
Sorry, I'm not sure if I understand. What exactly shouldn't be external?
your catalog
The catalog from the base game?
You do not want users to modify that one.
Yes
So basically just disable build remote catalog? I only enabled that while trying to fix the issue at hand
Yea do that first and then see about loading an additional one
Yeah that's how it was before, but enabling json catalog didn't fix so I tried to see if that helped in any way
I'm thinking of just using binary catalogs for mods, since this doesn't seem to be working at all
What unity version is this btw? It should work the same as long as project setup is the same for the mod maker
6.3 (6000.3.6f1)
Just a quick update: I switched to binary catalogs and now my mod loading works, so I guess this may just have been a bug.
Can someone help me under how to reference assets using addressables?
I'm having following structure:
All gameplay data is in BaseGameData group that is packed by label. Most of the plain data (Ability types, effects, status effects, etc.) are labeled default so they are packed together.
Each unit type has dedicated label because each units has uniqeu set of sprites that are never used by other untis, so if unit is not present in some scenario (level) there's no need to load them.
Scenario prefab itself is referenced as AssetReferenceGameObject.
Everything else (Scenario prefab -> UnitSpawnPoint -> UnitType -> AbilityOrder -> AbilityType -> Effect...) is referenced directly.
If I load Scenario prefab as an Addressable will it load all required groups that contain directly referenced assets?
Yes. If an addressable asset has dependencies in other groups/bundles then they are loaded automatically without you needing to do anything special. Addressables knows what other groups a single group depends on (and you can view this in the post build report)
And if I unload Scenario when the player leaves to the main menu, will those groups unload too if they are no longer in use?
Dependencies and or groups get unloaded when all users are released so yes they may
Thank you very much for the clarification
You can use the profiler to help track when you forget to release assets (requires a recent content build to work)
I'm loading an addressable with Addressables.LoadAssetAsync<GameObject>(tempAssetAddress).Completed += OnAssetLoaded, is there a way to pass additional arguments to OnAssetLoaded? Or to have the object returned from it?
I'm trying to do this in OnAssetLoaded
private void OnAssetLoaded(AsyncOperationHandle<GameObject> handle, NetworkConnectionToClient conn, CreateCharacterMessage message)
{
{
if (handle.Status == AsyncOperationStatus.Succeeded)
{
Transform startPos = GetStartPosition();
GameObject loadedPrefab = handle.Result;
characterSelection.playerName = message.playerName;
//characterSelection.characterColour = message.characterColour;
Instantiate(loadedPrefab, startPos.position, startPos.rotation);
// call this to use this gameobject as the primary controller
NetworkServer.AddPlayerForConnection(conn, loadedPrefab);
Debug.Log($"Successfully loaded and instantiated: {loadedPrefab.name}");
}
else
{
Debug.LogError($"Failed to load asset at address: {tempAssetAddress}. Error: {handle.OperationException}");
}
}
}
You can use async and await the loaded asset or use a lambda to do something different when Completed is invoked
Otherwise no an event/delegate subscriber must have matching args + return type.
alright thanks
This shows Not Found for me when I click on the survey link. Is it like that for everyone?
how do I actually do that? it doesn't let me use await for InstantiateAsync or LoadAssetAsync
UniTask has extensions to do this easier, otherwise I think you have to await the task inside the returned handle
UniTask is better than Awaitable and should be used ideally
how do I write an async method that loads an asset address and returns the object so it can be instantiated?
just doing await Addressables.LoadAssetAsync<GameObject>(tempAssetAddress);doesn't work, but I also can't return an object from an async method apparently
I need to load and instantiate objects and then apply properties to them once they're ready and idk how to go about that
You can if you use a task with a return value such as UniTask<GameObject>
private async UniTask<MyType> SpawnAndSetup(string address)
{
var newObj = await Addressables.InstantiateAsync(address);
var comp = newObj.GetComponent<MyType>();
comp.DoStuff();
return comp;
}
In this specific example you need to later Release() newObj
can I just return newObj?
Ofcourse
just change the generic type in the task return type
If needed go read up about async in c# to learn more how that works
awesome, thank you
So localization uses these weird guid variables for their build & load paths, but they're missing from the profile settings, and the analyze rules they provide is not correcting this. Does anybody know how to fix it?
Fixed it by deleting them + their schemas and running analyze rules after that
awhile ago i came in here mentioning i was having trouble getting Unity's stock URP materials/shaders to appear correctly when loading AssetBundles.
the problem ended up being that i'd let myself be misled by incorrect observations
- I'd made a test bundle-loader for use in Unity, not just on device, and bundles loaded this way loaded all URP materials pink for some reason
- So I found that nothing was actually "wrong" with the loaded materials, and changing their shader to anything, then back to URP/Lit seemed to "reset it"...
- So naturally I automated this in my bundle loader.... this was my mistake
Anyone able to make me a driveable bike or give me one for free cuz ive tried looking but cant find one. Cuz id like one that i could make into a suzuki pv. or smth. Cuz im new to unity.
I need it for a game
it turns out in BUILDS they wouldnt have appeared pink, only in editor for some reason, but I got confused by earlier observations and shifted focus to addressing why materials were still wrong in app.
The answer ended up being to leave the materials alone, do nothing with them, they work in build.
Address pink materials in editor only.
In editor if you test with built bundles for a platform OTHER than your editor one then shaders are pink because they are not compatible. Swapping shader fixes it because it then uses the platform appropriate one.
So it's not possible to test unless you swap to the platform your editor is running in
So windows Mac or linux
I see! Ty.
Is there a way to load localisation CSV file using addressables? I see i can add/update while in editor. But can the same be done at runtime?
Yea load it as a text asset and parse.
Or make a custom importer for CSV to have an asset pre parsed. Both can be loaded via addressables
is there any way I can do GetComponent on the returned thing outside of the function?
it's a GameObject inside of the function but when returned its a UniTask<GameObject>
but it doesnt seem to have a .Result or anything
private async UniTask<GameObject> instantiateAsset(UniTask<GameObject> loadedAsset)
{
Transform startPos = GetStartPosition();
if (startPos != null)
{
var prefab = await Addressables.InstantiateAsync(loadedAsset, startPos.position, startPos.rotation);
return prefab;
}
else
{
var prefab = await Addressables.InstantiateAsync(loadedAsset);
return prefab;
}
}
or am I doing something wrong still?
the loadedAsset comes out of
private async UniTask<GameObject> loadAssetAddress(string address)
{
var loadedObject = await Addressables.LoadAssetAsync<GameObject>(address);
return loadedObject;
}
Unity does weird things with their older async APIs so ignore that.
We have two main options to get the returned object from an async function: await it or use ContinueWith().
If awaited you can get the value and store in a variable as normal:
GameObject thing = await instantiateAsset();
Continue with let's you provide a delegate to execute once that task completes and use the object there instead. This is a pattern seen in normal c# tasks too.
https://learn.microsoft.com/en-us/dotnet/api/system.threading.tasks.task.continuewith?view=net-10.0
If you want to learn more then research how async works in c# normally. UniTask better matches Task so that should make sense more
what I want to do is instantiate the asset and then change its properties once its done but it doesn't seem to let me do that
You are then not correctly awaiting the async function
The two options above are how we can get the object once the task is actually done in the future
The point of async is that its a function that does not "complete" right now so we must handle getting the returned value in those special ways,
await can do this and ContinueWith() can too. Otherwise you just get the task that represents some in progress function!
yeah it was complaining because I had it inside a return void event but I think I just needed to change it to UniTaskVoid
Ah yea if you have void async or UniTaskVoid async its not awaitable but still a task.
void async just uses Task which we actually want to avoid hence unitask providing a specific type for this.
make sure you use .Forget() with these!
how do I actually do that for an event
can I have two handlers for one event
or do I have to register a different handler that calls the UniTaskVoid method and then Forget()
or can I turn the handler into an event itself that has forget as its own handler
or can it call forget() on itself
unitask docs say
public async UniTaskVoid FireAndForgetMethod()
{
// do anything...
await UniTask.Yield();
}
public void Caller()
{
FireAndForgetMethod().Forget();
}
but there is no direct calling method since it's an event handler
or is Caller() not supposed to be the calling method?
sorry you are mixing terms in a way that doesnt make sense
an event is not the same as an async function
You could invoke an event once some async task has completed if you wished? The unitask example you shared above is demonstrating how to call and not await FireAndForgetMethod correctly. .Forget() is optional but makes sure exceptions are logged and it makes a warning go away.
sorry I meant event handler, the FireAndForgetMethod() would be registered as one
you would need to use a lambda to wrap the call:
thing.Event += (someArg) => DoThingAsync(someArg).Forget();
If you need to unsubscribe later you can use a function instead or store the lambda in a variable.
good idea
Is this channel (addressables) something you use if you want to add modding support for your game?
I'm trying to build the addressable groups of my project and I get several errors like this one:
An asset is marked with HideFlags.DontSave but is included in the build:
Asset: 'Assets/Prefabs/Systems.prefab'
Included from scene: 'Assets/Scenes/Amenity 0.unity'
Asset name: ApplicationManager
(You are probably referencing internal Unity data in your build.)
UnityEditor.GenericMenu:CatchMenu (object,string[],int)
I know the error is that the prefab contains a MonoBehaviour named MarkAsManager which is configured to not be included in builds using HideFlags.DontSaveInBuild. But I don't understand why the error, the point of that flag is to exclude it from builds (and probably addressables). How can I fix this?
how/when exactly am I supposed to release prefabs? I thought I was supposed to do it in OnDestroy(), but I can't pass a handle to it
If you load a gameobject asset then you should release the handle/asset when all use is done (meaning all instantiations are destroyed and you will not create anymore)
InstantiateAsync is different, you need to release each instance
⬆️
You can release via the handle or the asset itself and if using something like UniTask then you probably only have the asset reference anyway
unity had a brain fart when making the AsyncOperation object 😐
For InstantiateAsync() made things yes
https://docs.unity3d.com/Packages/com.unity.addressables@2.11/api/UnityEngine.AddressableAssets.Addressables.ReleaseInstance.html
Do you understand the two difference scenarios I stated?
I think so
Great. give it a go, you can use the addressables profiler to verify that you are releasing things correctly
Thank you, I will try that
Hi. I have just tried for the first time to load an assetbundle of a scene with baked lighting but it gave me a pretty wild result. Here it is in my Bundle project
But after I load it into my app project as an additive scene (set as active) It has the right texture maps but LightingDataAsset set to None. Some trick I'm missing?
All the meshes come in NOT set to static, even though I exported the assetBundle with static flagged on so many objects
maybe that doesn't matter.... but there are 2 consequences of the above:
- Lightmaps appear in the scene but UVs are very wrong and wonky
- Light Probes are not functioning at all.
I re-exported my AssetBundles with these Shader Stripping settings for lightmaps, basically changing the dropdown from Automatic to Custom and just keeping everything. It seems to have worked.
Make sure to manually re tetrahedralise after doing additive scene loading/unloading
https://docs.unity3d.com/6000.2/Documentation/ScriptReference/LightProbes.TetrahedralizeAsync.html
I don't understand why a scene loaded with addressables is pink.
The profile show the scene and materials are active.
What am I doing wrong?
In fact the materials are even loaded twice, in the same group as the scene, and in a separated one. Yet, it's pink when I use build mode rather than asset database... I don't understand why
just to check, what platfom are you building for? if the shaders in the bundles are for a platform that isn't PC, you won't be able to load them on PC in editor
Uh, MetaQuest (Android)
Is possible to build a bundle for Windows without changing to that platform? So my editor could work
that is the way to build the bundles for windows, basically
I mean, without doing "Switch platform". That takes ages
if you need to switch back and forth a lot it can be worth making a separate checkout of your project for each platform!
Sometimes when I do a build for metaquest and I open the build in the headset, the textures are also pink. But I did an addressables build before. What would be the case then?
I told someone about this exact issue not long ago, if you build android bundles and try to test with these in editor the shaders will be broken because they are built for android...
Solution: change to your OS platform, build bundles and test
Your content builds must be on the correct platform always
e.g building with windows platform active and trying to use this in an android build will not work
that was me, yep, use windows bundles for previewing on windows. It doesn't matter if your Unity Editor is set to something different.... but im talking about IMPORTING and previewing your already exported bundles in the editor.
Seeing as you actually seem to be talking about the annoying progress bars everytime you go to build bundles because of the platform switch, that's unavoidable i think
that'd be like trying to build your game without switching to the right platform first
I made a "build all" button, so I can just go have a cup of tea while Unity navigates through all 4 platforms
I want to instantiate an addressable (AssetReferenceGameObject) in editor mode and save the result in a prefab. The instantiated object is just for show so designers can see the addressable they are putting on the scene, and it is removed on PostProcessScene. I am currently trying to do it with InstantiateAsync, but I am getting some errors and the addressables (mesh and material) are losing reference after the prefab is saved. That leads to the errors "Could not extract GUID in text file " and "Broken text PPtr. GUID 00000000000000000000000000000000 fileID"
My question is, how do I use object.instantiate in an AssetReferenceGameObject? Is there a field to get the gameobject in the reference?
Or is there another simpler solution?
For clarity, I am using addressable for streaming objects, so they only load objects close to the character, and unload when they get to a certain distance.
if you just need to access it in editor, use the editorAsset property
Thanks, that is precisely what I was looking for
Random question. Let's say I have a rock prefab in the scene (without addressables), then I load the same rock in the scene using addressables. That will result in the shared material of both rocks to be different, so all non-prefab rocks will use one material, and all rocks instantiated with addressables will use a second clone material. Is that the intended behavior, or there is a way to make all rocks use the same material?
This is just a curiosity question since I noticed that behavior, there is no goal to achieve here.
It depends on if this scene is addressable or not. If the scene is not then yes these would be separate assets
Ohh, makes sense. Thanks!
i thought assetBundles dont work to their fullest in the editor as the assets dont all import in the exact form by which they were exported, certain things become basically uneditable once they're in a bundle
Ive loaded them in the editor myself but had all kinds of shader issues and had to deal with the fact they were basically temporary
I'm building addressables for Meta Quest. I build the app as development and install there.
When I open it the scene has all the textures fine... but after a few seconds all become pink. Why is that happening?
I'm using the following config if it gives some clues 🤔
mmm, I think I get the error if I call the AsyncOperationHandle<SceneInstance>.Release() from the instance returned by Addressables.LoadSceneAsync. But I don't understand, I thought I could release it because the scene would keep a reference, and when the scene gets unloaded it would free the last reference.
Must I keep track of it also?
You use that to unload the scene.
https://docs.unity3d.com/Packages/com.unity.addressables@2.11/manual/LoadingScenes.html
But when the new scene loads the gameobjects from the current one (including the component LoadSceneByAddress) will be destroyed, which would release the operation and then break the references of the new scene, isn't it?
Does this imply I can simply fogoe to call the .Release() in the load scene operations because it will be automatically done when the scene is unloaded? 🤔
Anything loaded in the scene gets the use released yes
Not sure what else you may mean
I mean I can do:
Addressables.LoadSceneAsync(a).WaitForCompletion();
/// play
Addressables.LoadSceneAsync(b).WaitForCompletion();
I never call .Release() because as soon as the scene is unloaded by Unity it gets released.
Wrong
If manually loaded it needs to be released manually
Ups, I mean LoadSceneAsync not LoadAssetAsync (just fixed my example)
Is still wrong @honest halo ?
Single mode scenes require extra things to unload safely
https://docs.unity3d.com/Packages/com.unity.addressables@2.11/manual/UnloadingAddressableAssets.html
I don't understand
So must I use ResourceManager.Acquire in the scene? Then what is the point of automatic unload if I require to manually track it?
I'll be honest I don't even get it myself. I've only used additive addressable scenes myself
Some of this is a fucking mess it's sad how this can't do this stuff for you
Ohh, I see
I'm trying to make a system that unifies the usage of addressable and non-addressable for our projects as we want to start using both and all the information I find about addressables is so incomplete or messy
If possible id just migrate everything to addressables as it makes it a lot easier to integrate
Someone else have experiencie with single load with addressables? Must I always track the handle to release it or is there a way to do that automatic when I load the next scene?
Well, I noticed that if I never release the operation handles of loading single scenes, everything seems to work fine, no memory leaks
So I assume Unity releases it for me as soon as another single scene replaces the previous one
If you verify this from the profiler then must be
Yeah, I did
BTW, does Unity have some way to (for develoment testing) convert my pc into a server for bundles? I mean, I want to check if my installed app in the MetaQuest can successfuly download update bundles, but I have no hosting solution yet.
I mean, I think the company I work uses firebase, but I haven't asked my boss access yet until I figure out everything in my pc...
You can host a http server locally using something like nginx or Apache. May be a tad harder on windows if you pick one of these.
there's no way to use addressables purely sync without any async stuff right?
can I have something like asset references without using addressables?
like a prefab dictionary?
You can do a List<GameObject>
What is this for?
it looks like I can't use actual addressables because they're async and mirror networking doesn't support async, so I'm trying to come up with something that gives me similar functionality without async
in this case, I want to be able to instantiate a prefab from the prefab name
or some other string or something thats linked to the prefab
Just make each prefab a GameObject and add that to a list of game objects
Ex:
GameObject prefab1;
GameObject prefab2;
List<GameObject> prefabs = new List<GameObject>(){
prefab1, prefab2
};
Then to add the prefabs in the inspector, you will have to add the script to an element in the scene
Above should work
this can be a dictionary right? using numerical keys to pick one would be very impractical
Yeah, like a Dictionary<int, GameObject> prefabs would work as well
alright thanks, I'll see if I can use that
Yeah
Its possible to stall the main thread to wait but if an asset requires a download then thats gonna fuck things up
and addressables is very incompatible with libraries like mirror where prefabs must be assigned in one very specific way
unless they allow runtime addition of such things i dont know
yeah I figured that out today
I think it will be best to not use them
unity netcode for gameobjects supports adding new assets at runtime so mirror may as well.
This would mean you can load things from addressables and add as you need
https://docs.unity3d.com/Packages/com.unity.netcode.gameobjects@2.11/api/Unity.Netcode.NetworkPrefabHandler.html#Unity_Netcode_NetworkPrefabHandler_AddNetworkPrefab_UnityEngine_GameObject_
yeah but honestly they add so much complexity and headaches, I'm not sure if they're worth using at all for my project
I thought it would be a lot easier
its not that much effort to load many assets via a tag and add them before server start/client connect but up to you
is that preferable to a list of SOs to instantiate from?
if you prefer, it was just an example
as long as the scriptable object is addressable then that works
if I understood it right, with adressables I have to instantiate all the prefabs at once at game start since I can't use instantiateAsync during mirror operations, but if I use a list of SOs instead of addressables I can instantiate at will
No you would just load the prefabs from addressables and add them
I hope you know that you can still load the prefab asset from addressables and use it like normal
the downside is that these would be loaded in memory forever
hence loading them ahead of time
GameObject asset = await Addressables.LoadAssetAsync<GameObject>("CoolPrefab");
AddPrefab(asset);
StartServer();
yeah but I'm worried about everything being loaded into memory at all times, it seems like something that could cause problems later when I can't fix it anymore
prefabs added to the list before are loaded in too so there is no difference there
It just means we loose the benefit of loading a prefab only when needed later in time
The only solution is a custom prefab provider that can load things in a special way but no idea if these support async either
I was gonna have a SO for each character and a dictionary of SOs from which I instantiate when needed
what matters here still is that mirror expects the object being spawned to be in the network object list right then
addressables or not thats still the requirement
same for NGO
mirror has a list of spawnable prefabs that I need to give it before the game starts but I'm not sure if that means that it loads them all right away
You said the answer, yes 😐
If they must be added before starting the server then thats YES
I see
I thought it just keeps a reference until the asset is needed
but that makes sense in a way
Only loading via Resources or Addressables can defer the asset load till later
a serialized reference to a GameObject requires that to be loaded into memory
so I instantiate all the addressables, then register them like that at the start right?
No why do keep saying Instantiate? You can still load the prefab asset from addressables. You are not forced to use InstantiateAsync().
If this still confuses you then just give up using addressables till you understand the difference between a prefab gameobject asset and an instantiated gameobject in a scene
it's what someone told me in the multiplayer thread, I'd instantiate everything at the start and then during the game spawn as needed
then they are wrong
alright
all these networking solutions require you to configure the prefab assets that may be spawned later
prefab asset != gameobject in scene
therefore instantiate is incompatible
ok so load and later spawn, no instantiation
yea because we let mirror/NGO handle the spawning. you may be able to jankily use a scene gameobject but i bet it would have issues
I'm developing a WebGL app
It used an asset management system that was built on the Resources api, and it worked fine, easy and fast
but I was not satisfied with the absence of any asset indexing, and i read online that Resources is more for prototyping and labeled as obsolete, so i decided to shift to Addressables
after setting up new infrastructure, i realized that assets start taking more time to load with addressables rather than with Resources
basiacally it loads 2500 json files, which takes 10x more time to execute with addressables
it might be a problem with async loading on WebGL i guess
i do not have experience with addressables at all, so at this point i have two options
stick with the older system and build indexing on top of it
or somehow fixing up new system
i would ask for advice on how to handle this properly
Hello everyone,
I’m currently in the planning phase of an app and I’m trying to figure out the best way to handle content delivery for 3D assets.
After doing some research, I came across Unity Addressables, but I haven’t found a complete guide that fits my specific use case.
What I’m trying to build is an in-app shop system connected to a backend service like Supabase or Firebase. The database would store:
- Product name
- Thumbnail
- Price
- Other metadata
- Most importantly, a reference/link to a 3D model for that product
The idea is that when the app launches, it queries the database and automatically pulls all available products dynamically.
What I’m struggling with is the best workflow for handling the actual 3D model delivery:
- Should the models be hosted through Addressables?
- Should the database only store Addressable keys/URLs?
- What’s the recommended setup for downloading, caching, and updating models without pushing a full app update every time new content is added?
I’d really appreciate advice from anyone who has implemented something similar or can point me toward a good architecture/workflow for this setup.
Thanks!
On webgl managed threads do not work but asset bundle loading should be native.
It may be wise to better optimise the compression and packing settings for the group OR just load the json externally
To serve each asset on its own this could be done with addressables but perhaps just serving a GLB model and using glfast to load it at runtime would be easier.
are you loading them one by one. Can you group them on priority basis.
can you use scriptables?
Good point.
@fast lily Do you load them all then await all results or load one after another?
Do share an example if possible
var loadModelTasks = new List<UniTask<JsonModel>>(BlockModelFileTable.Keys.Count);
foreach (var blockModelId in BlockModelFileTable.Keys)
{
try
{
loadModelTasks.Add(BlockModelLoader.LoadBlockModel(blockModelId));
}
catch (Exception e)
{
Debug.LogError($"Failed to load block model: {blockModelId}");
Debug.LogError(e);
throw;
}
}
await UniTask.WhenAll(loadModelTasks);
i guess i can
just make scriptable with all files?
This is good loading so im going to presume that the nature of webgl means loading concurrency is just worse all around.
Check the network tab in your browser debugger to see if the bundles download all together
i belive web has limit on concurrent load request
Could also explain it unless these are all within one or a few asset bundle files (based on your bundle mode for the groups)
again you can debug this in browser
all files related to one bundle
and in network tab it shows only this bundle been downloaded
bundle has been fetched from the cache in around 40ms
so deal might be with individual file loading i guess
All I can think of is not loading all files at once if not needed, change the compression settings or ditch addressables and download the json via a web request
i have a similar idea
wanna implement it and take a look
presumably webgl does not like downloading a lot of small files, likely due to the request limit, which is around 6
so i fixed issue by merging all json models in one big json file
Hey.i got a question, to load maps should I use addressables to load the whole scene or just the environment prefab
hello! im trying to make a custom addressables build system for modding but when i try to execute "BuildAddressable", it doesn't build anything at my path at all
it makes the group in the addressables group tab but it also doesn't put pallet.crates in it
It depends if all the assets in the scene should be addressable too. If yes then you must to avoid duplication
What is 'build path' and how is this constructed?
Also random but that first asset path looks nasty
There isn't much point automating this for modding btw if you plan to simply merge in the user catalog
buildPath => Path.Combine(Application.persitentDataPath, "Builds", "Mods", EditorUserBuildSettings.selectedActiveBuildTarget) iirc, im not at my pc rn
First thing to check then is that this path is correct (e.g using a debugger/ logging) and check the build report to confirm bundles were actually made
i turned on the report thing but no report or bundles were made in that window which i found strange
also is there any examples or docs for this?
cuz I'm interested
here https://docs.unity3d.com/Packages/com.unity.addressables@3.0/manual/LoadContentCatalogAsync.html
The main idea is that after loading in the other catalog then all of its content can be used. I think the returned resource locator would let you access all of it too 🤔
This content cannot reference the main content however due to being compleatly separate
Can anyone guide me for simplest way to getting started with addressable ?
i’m having a lot of troubles with handling addressables in the editor right now
in play mode teardown/restart issue and want to verify the correct fix pattern
setup:
- unity editor
- addressables using packed/existing-build style play mode
- content is already cached locally. logs show sizebytes=0 and remotelocations=0, so this does not look like an active network download
- flow is roughly:
- initialize addressables/catalog
- preload map/scene label dependencies
- load/activate gameplay scene
- start game/session runner
- runtime systems load required content assets through addressables
- on play mode stop, services release/cancel addressables handles in shutdown/ondestroy
failure sequence:
on stopping play mode, i sometimes get:
AssetBundle.Unload was called while the asset bundle had an async load operation in progress.
AssetBundle.Unload could not complete because the asset bundle still has an async load operation in progress.
then, after entering play mode again:
The AssetBundle `<bundle>.bundle` can't be loaded because another AssetBundle with the same files is already loaded.
error while getting asset bundle: The AssetBundle `<bundle>.bundle` can't be loaded because another AssetBundle with the same files is already loaded.
after that, a required runtime content database asset fails to load because its dependent bundle cannot be loaded
my current theory:
a cached/local addressables assetbundle async load is still in progress during play mode teardown
our code releases/cancels its own handles/waiters, but that does not guarantee the underlying assetbundleprovider operation has completed before unity unloads/reloads bundles
next play mode session then hits the duplicate “same files already loaded” bundle collision
questions:
- is this the expected addressables behavior when handles are released while provider loads are still in-flight?
- is
OnDestroyinsufficient here because it cannot await completion? - is the correct pattern to preload/await required runtime content before starting the session, hold the lease for the full session, then explicitly await/drain tracked in-flight addressables operations during normal shutdown?
- is an editor-only
PlayModeStateChange.ExitingPlayMode + WaitForCompletionguard reasonable as a last resort, assuming it is only used for already-started cached/local operations and not remote downloads? - what kind of play mode/integration test can actually catch this? fake handle tests passed but did not reproduce the real assetbundleprovider race
have you disabled domain reload? In edit mode if you wanted to get addressable assets we ideally want to bypass addressables and actually use asset database.
Trying to do play mode things before play mode begins seems like a dumb idea and you should instead have editor only asset preloading (as addressables would normally use this anyway by default as you probably know)
Hey folks i am having a issue with addressables while i load the scene with activateMod = false awake and onEnable of mono's runs in loaded scene before handle done log is it normal ?
Tried both single and additive.
protected override async UniTask<SceneInstance> RunAsync(IProgress<float> progress, CancellationToken cancellationToken)
{
Debug.Log($"[AddressableManager] Loading scene '{m_key}, {Time.frameCount}'");
AsyncOperationHandle<SceneInstance> handle = Addressables.LoadSceneAsync(m_key, m_parameters, false, m_priority);
while (!handle.IsDone)
{
float percent = handle.PercentComplete;
progress.Report(m_activateOnLoad ? percent * 0.9f : percent);
await UniTask.Yield(PlayerLoopTiming.Update, cancellationToken);
}
Debug.Log($"[AddressableManager] Handle done, {Time.frameCount}'");
}
Repro steps:1) Open the project and scene Awake in it2) Play and notice that exception appeared (ERROR ERROR ERROR)3) Stop and load ...
Really... still in unity 6 but not found in any doc
Anyone encounter this issue or "design" put a frame delay before call...
Debug.Log($"[AddressableManager] Loading scene '{m_key}, {Time.frameCount}'");
await UniTask.Yield(PlayerLoopTiming.Update, cancellationToken); --> FIX
AsyncOperationHandle<SceneInstance> handle = Addressables.LoadSceneAsync(m_key, m_parameters, false, m_priority);
while (!handle.IsDone)
{
float percent = handle.PercentComplete;
progress.Report(m_activateOnLoad ? percent * 0.9f : percent);
await UniTask.Yield(PlayerLoopTiming.Update, cancellationToken);
}
for future reference, this is not true, they don't get loaded just because they're registered
they must be instantiated
i had this error in the builds as well and i could replicate it in the editor
the same error/behavior/logs
How can I figure out at runtime if a project is using Addressables?
like the package manager? or a built game?
In a built game, to check if the game is actually using addressables (I mean, you can have installed the addressable packages but have never created the settings file to use it).
At the moment I figure out I could do File.Exists(Path.Combine(Addressables.RuntimePath, "settings.json")) but doesn't look very resilient...
i would say just check the managed folder lol
I'm not sure what you mean. Where I get the address of the managed folder?
just click the data folder and click the managed folder
like here, i know my game has addressables in it
That would tell me there is an addressables dll, but not if the dll is actually used (that is, the developer configured the profile and settings of addressable).
In the editor you can always check if AddressableAssetSettingsDefaultObject.Settings is not null, but this is not available at runtime.
You can't know and even if you could how is that even useful? A scene or asset may not even be from there
Is this for modding? Sounds sus
It's not for modding.
I have a library that can be used in projects:
- Without addressables: uses Resources to load some data.
- With addressable included as package but never configured: still uses Resources to load some data.
- With addressables included as package and configured: uses Resources + Addressable's Labels to load some data.
The data is a list of scriptable objects actually
In editor you can check dynamically. You can then use a build post processor to store this state for builds.
Or you make it possible for the user to configure the data source so they can pick. If this lib uses async it allows for both safely.
You could also just auto configure a group if addressables is installed and again enforce this in editor/pre build.
I see, never used a build post processor, I should check that. Can a post processor "inject" a file in the resources folder? I would use that file to store the configuration state that determine if addressables is or not configured, I think.
Yea it can do whatever as you can have a function execute before the build even starts
my solution to that is to have my library in its own assembly definition, and then modify version defines to look for the addressables package. If it exists, something like ADDRESSABLES_INSTALLED define is added and you can wrap your addressable-only logic in conditional statements
Yeah, I do that also. But that only tells me if addressables is installed, not if addressables was configured
Documentation
Addressables: https://docs.unity3d.com/Packages/com.unity.addressables@latest/index.html?preview=1
https://forum.unity.com/threads/addressables-are-here.536304/
Forums
https://forum.unity.com/forums/addressables.156/
Blog
Planning and best practices: https://blog.unity.com/engine-platform/addressables-planning-and-best-practices
Optimisation with addressables: https://blog.unity.com/technology/tales-from-the-optimization-trenches-saving-memory-with-addressables
Videos
Addressables for live content management: https://www.youtube.com/watch?v=THs7h-wXHBg
Samples
https://github.com/Unity-Technologies/Addressables-Sample
Ask questions and discuss anything to do with Unity's Addressable Asset System!
whats an addressable
Please look at the linked documentation before asking basic questions.
Literally explained on the first page of the linked manual.
Vertx, a good candidate to add to pins, explaining how to pack things separately as well. https://blog.unity.com/technology/tales-from-the-optimization-trenches-saving-memory-with-addressables
try reading it
Someone told me that addressables packages each asset independently, and doesn't create larger bundles period.
Content packing: Because the system maps and understands complex dependency chains, it allows for efficient packing of bundles...
Also the entire blog post right there dedicated to how to not to pack everything together
Vertx, a good candidate to add to pins, explaining how to pack things separately as well.
Instead of concentrating on how to one up people. Try to actually understand what they are saying.
Manual is a great start. I used it to build my first bundle.
Forum which is linked there as well. Have more examples for advanced use. Make some effort instead of complaining
You should just stop. And the second my message after your post was answering your question. You were too busy apparently complaining to read it.
@fierce basin This is not a platform for you to imagine slights and post poorly thought out complaints. If you continue with this you'll be muted.
!mute 160509516641861632 1d Ignoring warnings.
Twiner#8757 was muted
Wow, such drama here.
First of all, both were answering very unpolite to each other.
I expect this from random people from internet, and agree there should be some actions on them.
But I DO NOT expect the same behaviour from moderators.
Very dissappointing for people looking for help.
Not everyone has the same level, in knowlesge nor in cognitive reasoning.
You more than everyone should keep that in mind.
I'm sorry, you walked into a bit of history here. Twiner character is not a novice. And I was a bit provoked by the empty rhetoric like this:
Honestly, the documentation is crap
But in the future, if you have concerns, please voice them in #531949462411804679 instead.
If you are not going to answer newbies questions, you probably should rename to Advanced Addressables or similar. Otherwise It Will be missleading to many people.
You can ask newbie questions. You just cannot ask "what is an addressable" literally 1 post after the pin linking to the doc explaining just that.
Well, you can do that too, just don't be surprised if you're referred to the manual
I have addressables uploaded to a remote by BuildTarget - e.g. StandaloneWindows64/catalog_xx.json - I feel very dense but I'm really struggling to work out how to get the BuildTarget path at runtime. I can get the RuntimePlatform but that's no good and doesn't map 1-1. I realise this is all supposed to be automagically handled by the AddressableAssetSettings but in my case I'm modifying the paths at runtime. I'd settle for setting e.g. the remote load path to [BuildTarget] and reading that at runtime... but AddressableAssetSettings is in the editor namespace... once again leaving me feeling really dumb. Any pointers?
Well, I have been using AssetBundles for 5 years and Addressables for around 1 year.
I wont do that. But Im very sure a lot of people will ask, since this is already an advanced topic for most.
Lately what I have been figthing the most is to avoid collegues to create a chain of bundles.
It is very easy to add a reference to something inside a bundle, that reference another thing, and another.
And by loading some bundle you effectively download 30 more bundles as dependencies.
And you will not notice until you have players complaining It takes too long to load something.
I had to build some rules with strict sizing and analyze dependencies to avoid surprises.
But to my surprises the URP shaders keep growing and growing in size.
Not chaining dependencies with bundles sounds like a good candidate for #archived-unitytips
@mild flax Did you see this post? https://forum.unity.com/threads/change-remote-catalog-load-path-at-runtime.712052/
I did, thank you. Unless I'm missing something I don't think it helps me.
Yea, sorry I don't have personal experience with remote deployment even. Maybe someone else has.
Oh sweet an Addressables channel!
Hi, can someone explain why addressable bundles sometimes not included in game build (platform: android)? buildPath not included in .apk
Now workaround is press Build Player Content -> Then Build Game. Or it is rule - should always build player content before build game?
Apparently, you don't have to build addressables before every player build, although every once in a while, as you said, they are not included for some reason, which seems to be random. I've been living with this for a while now, never really got into deeper investigation of this issue. I think I've seen some custom code on the forums that will always run addressable build process before player build, that might be a temporary solution.
these are the questions I expected to see here lol
Suggestion
Yesterday, I implemented some post-processing editor code for addressables using AddressableAssetSettings.OnModification Action property. I think it'd be very helpful for users if the documentation mentioned what type does the system pass into the third parameter of type object (System.Object) for each AddressableAssetSettings.ModificationEvent. I totally understand why is there an object type, although in order to cast it back to its original type and to be able to use that data, the user needs to know what type is being passed in. One can simply Debug.Log the object to find out what's its original type, although in case of events that pass in generic types (such as EntryAdded, which passes in a List<AddressableAssetEntry>), it's really just a lot of trial and error and deduction to find the actual type.
I recommend putting this up on the forum if you haven't already. Odds are the right people won't see it here.
Will do
Does anyone know why the package manager in my 2021.1 project tells me that the latest version of the Addressables package is 1.16.19 rather than 1.18.4? When I update the manifest file manually it works, but asks me to "update to 1.16.19".
Is there any way to get all AssetReferenceAtlasedSprite from a SpriteAtlas?
I would basically want to have a method public AssetReferenceAtlasedSprite[] GenerateAllReferences(SpriteAtlas atlas) that gets all references procedurally.
Hmm, that is strange since 1.18.4 should be available for 2018.4+, maybe it is just an issue with that Unity version. Try to update to the latest 2021.1.7 if you didn't yet.
Anyone having trouble with addressables and enter playmode options?
If I try to get an addressable it will tell me the AsyncOperationHandle<T> is valid, but it will return null
It works after a domain reload, but subsequent starts will not work
Hey everyone! Is there any way to build only selected / changed groups of assets? I am trying building an update but it seams like unity is proccessing all of the groups anyway..
I quite struggle to understand how addressables work together with bundles, if they are even designed this way
in my project, I want to build my content into bundles, and also use bundles for dlcs and community mods, but I don't know whether to use addressables to access that bundles, how to get a specific content/asset type from it, etc. (preferably if it could work in editor as well, without building the bundles, and without much of a setup)
Is this broken just for me? I can't get it to work for the life of me. Addressables.cs:93-99 explicitly has code to address this, but it does not seem to work...
What's weird is that Addressables.InitializeAsync returns the key I am trying to get. If I try to get it it will return null however...
I made a thread on this if anyone wants to chime in, maybe this is a bug after all 🤷
https://forum.unity.com/threads/addressables-acting-strangely-with-enter-play-mode-settings.1114939/
hello guys, want to ask about the Addressable Asset Bundle.
How do I retrieve the bin data from cloud content delivery and instantiate a gameObject?
Thanks, but I'm already on the latest Unity version...
Hi guys.
I have a folder full of sprites marked as addressables.
I'm writing an Editor helper thingy to boost the workflow and I need to know how can I make all subassets of that folder as addressables as well?
This is required to make bundles be packed separately.
FYI you can mark a folder as addessable if that helps
I'm just starting out with Addressables but in order to do that you need to load the remote catalog (LoadContentCatalogAsync) - once the catalog is loaded you can basically instantiate as normal, using the key. If I'm right, the main caveats seem to be 1) the remote path you upload the files too actually needs to be baked into the catalog(!?), 2) you need to have the correct settings to ensure when you build your addressables you get a catalog_xx.json & catalog_xx.hash
hey, is it possible to create an addressable content build on a separate PC before the player is built on another one (such as part of a CI/CD task)? Will that work or would I always need to run a content build before running the player on the same PC?
It's already marked as addressables. But unfortunately "Bundle Mode: Pack Separately" does not work as I want (it generates a single bundle for the folder) while I need each subasset as a separate bundle. The only way to do that if I understand correctly is to mark subassets as addressables too.
I believe it's possible but setting it up will require a lot of trial & error if my experience so far is anything to go by. V poor docs & info out there atm. Fwiw I found this video helpful: https://www.youtube.com/watch?v=KJbNsaj1c1o&t=314s
Ah, yea.. that sounds like a pain - it's something you'd hope would be an option. I don't know of the exact property you'd need to set in a script but hopefully it should be quite simple 🤞
Yeah, it turned to be simple. To do that the asset entry should be moved to a group. And that's what I was trying to do. My problem was that I tried to move a sub-sub-asset (a sprite contained in the texture contained in the folder) and that was making Addressables not happy.
The right way was to move the sub-asset (the texture)
Hey everyone
Does anyone know how to upload OSX and windows addressables to CCD?
Or do i need a different bucket per platform?
If you build them with e.g. [BuildTarget] in the path, they'll end up under separate directories which you can then upload. So you'd end up with e.g. Http://remoteblah/StandaloneWindows/catalog_xxx.json
@mild flax Yup i have them saved as seperate directories via Unity Cloud which also uploads to UCC.
But starting a OSX build starts a new release with only OSX
I suppose my issue is i need to manually upload them to the same release... which i can do by hand really
Not sure I understand. I may just not be able to help. Afaik you don't need separate buckets and I'd expect you to have to switch platforms for each platform-specific build you do. Fyi I did see a forum post about how when you switch platform via editor script, the Remote Load Paths etc aren't re-evaluated.
Ah right. I'm using Unity Cloud Build to create my builds (include addressables) and have them upload to UCC.
Going to try running a couple builds to see if they upload and it works... i think my problem is having the lastest release only using OSX but i'm trying to use Windows assets
Ah sorry I misunderstood you were building in the Cloud. I'd appreciate you reporting back if you work out what the issue is - I've not tried cloud builds yet so I'm not of much help but shared knowledge is good 👍
@mild flax Ah okay so my attempt didn't work.
Uploaded OSX and windows to UCC and still get the 404 error
Should i be uploading the .hash?
?path=/catalog_2021.05.15.23.43.32.hash
UnityWebRequest result : ProtocolError : HTTP/1.1 404 Not Found
the catalog json, hash & assetbundles all need to be uploaded, yea
Great. It's uploaded.
So not sure why Unity can't load it 🤔
fyi I think ?path=/catalog_2021.05.15.23.43.32.hash should be ?path=ServerData/StanloneWindows/catalog_2021.05.15.23.43.32.hash
@barren sparrow No reaction gifs, please.
@languid widget Noted! Sorry!
@mild flax Rebuilding with the new path worked!
Thanks 🙂
hi, so following this logic if my profile's RemoteLoadPath is https://<client-id>.client-api.unity3dusercontent.com/client_api/v1/buckets/<bucket-id>/release_by_badge/latest/entry_by_path/content/?path=[BuildTarget] , I should be able to keep the bundles for each of my platforms in the same bucket, right? As long as there is a folder for each platform in the root, it should work?
or would the RemoteLoadPath need to be https://<client-id>.client-api.unity3dusercontent.com/client_api/v1/buckets/<bucket-id>/release_by_badge/latest/entry_by_path/content/?path=[BuildTarget]/ with an extra / in the end?
@drowsy sluice no / at the end. i learned that buy trying it with a / and it resulted in //catalog_....
great, thanks, I'll give it a try
Whether this works with one release will depend on how you are referencing the buckets in Addressables. In other words, if you are pointing your addressable build profiles to the "latest" badge, then you'll not be able to use the same release for multiple platforms.
Personally, I went down this path and it ended up being overly complicated to manage. I'd recommend you do a release per platform and then in Addressables setup build profiles per platform. In Cloud Build you can point your Addressable config to the CCD release, so it all stays automated and clean still.
I recently posted a new tutorial for Addressables in case anyone here is just getting started. It's a two part series - the next will cover integrating with Cloud Content Delivery.
https://gamedev-resources.com/load-unload-and-change-assets-at-runtime-with-addressables/
Addressables are considered "the right" way to manage assets within your game and helps tremendously with memory allocation. Get an overview of what the Addressable system is, the benefits in using it while learning how to dynamically load/unload an addressable by instantiating a prefab and changing a texture reference.
Thanks! I'll give that a try
Hello, I need to generate some specific data when building standalone build and bind it to an address, can someone please point me out where to look? The scenario is something like this: when building a standalone build, make a build step which instantiates a specific scriptable object, fills the data, binds to an address and includes that in build, so I can load that in runtime. That's not a file in the project all the data is generated on the fly, so that's just temporary object in memory which exist only during the build. Is it possible?
Can't create Unity assets outside of the editor AFAIK. But you can store serialized data separately in addressables, create virtual scriptable object and fill it with that data.
Hmm, if I do this during build as a step in scriptable build pipeline I guess I still can create asset in memory, no?
Not familiar with SBP, but if you are in Editor you should be able to use editor methods to create asset and add it to build.
hi, did anyone here manage to run the CLI tool that connects to the Cloud Content Delivery service on a remote runner (e.g. in a GitHub Action step)?
I get the following error Error: You must run: pass init your-gpg-id before you may use the password store. after trying to run chmod +x $UCD_PATH $UCD_PATH auth login $CDN_PROJECT_ID $UCD_PATH config set bucket $CDN_BUCKET_ID $UCD_PATH entries sync $BUNDLE_PATH in my CI/CD pipeline on GitHub
Hello, I want to use play asset delivery system and ios odr system for updating contents. but I couldn't understand how they working with addressable system, when I searched about it its not currently supported and I wanna ask is possible to use assetbundle and adressable together? assetbundle for delivery and adressable for usage. sorry I'm confused, I really doesnt understand how can I do it
Very strange, if I upgrade from 1.17.17 to 1.18.4, I cannot use addressables outside of playmode anymore. When stopping playmode, current addressables (e.g. scriptableobjects) are destroyed, and anything in the editor using addressables to load these object will throw a This Object has been destroyed... error. Is this intended?
Very annoying :/
Another question in case someone knows: Can you safely use addressables from another thread? I can't seem to find any documentation on that...
My guess would be no but it would be nice to have confirmation
well we know that any Unity API can't be used from another thread
So I'd go into the code and look for any Unity API calls to answer your question (or even using UnityEngine is enough lol)
almost all unity calls are non thread safe
the ones which are, have ThreadSafe attribute to the function/property when you inspect it
how do you guys get a list of all the assets loaded in a scene?
before even using addressables (i avoid that thing)
There are several plugins for it or you just keep track of it yourself in a List or what not
is there a way to reload the current scene, if I am loading my scenes using addressables?
Since Addressables.LoadSceneAsync takes an AssetReference or asset address string, and SceneManager.GetActiveScene returns a scene object... I'm a bit confused as to how you can get the active scene, and then load it with Addressables.LoadSceneAsync
Can you pass the scene object to addressables directly? or perhaps... loading a scene async isn't even necessary in this case since the scene is already loaded? Any help in understanding how this is intended to be used is much appreciated 👍
You don't need to use Addressables for the reload
Or wait... maybe you do? 🤔
I'm not sure nevermind lol ignore me. The scene might not be in the build settings if it comes from addressables right? 🤔
yeah if you are using addressables for scenes, they should be removed from the build settings (and therefore don't have a buildIndex)
I had a... guess... that because the scene was already loaded you can just call SceneManager.LoadSceneAsync(SceneManager.GetActiveScene())... its just a bit awkward since most of the scene loading logic I have is all using addressables... except this case.
so yeah, was curious if there is a better way or just something I'm missing
Hey, I have a problem with downloading updated bundles from a cloud: whatever I will upload, downloaded assets are always the ones that were uploaded as the firs ones.
I am using 'Use existing build', build path and load path are set as remote. My steps are:
- Build
NewBuild - Upload it to the cloud
- Run the project: they are getting downloaded, everything works fine until this point. (It's worth mentioning that if step 2. is skipped I see errors here, so the project IS downloading assets from the cloud)
- Change for example a color of sprite in one addressables prefab
Update a Previous Build- Remove what's stored in the cloud and upload updated assets
- Run the project: the assets I see are the ones I saw in step 3. They don't change 😕
Does anyone have an idea on what can be wrong in my setup? I'm out of ideas 😔
google asset bundle version - you can tell it a new version so it downloads again
Does anyone know how to get the addressable ID from a loaded instance of an asset?
(This is so I can serialize references in a save game)
😮 and where can i find this mythical value?
If you find out let me know. My solution is a horrible one
I save a "self reference" AssetReference on my prefabs
[SerializeField]
AssetReferenceGameObject selfReference;``` T_T
public AssetReferenceGameObject SelfReference => selfReference;
so when I save - I save that assetreference GUID so I know which prefab to instantiate when I load
You can get an addressables PrimaryKey by using an IResourceLocation which will return the addressables "group name/addressable name".
A method is described in this link (but you should use PrimaryKey not InternalId... the thread is a little outdated now)
hm, a bit confused but this doesn't seem like what I'm looking for. I have an asset and I want to turn get its asset ref.
This would work. I wonder if I can set it on OnValidate
Ooh if you can figure out how, I'd love to "borrow" that code
because currently I have to set it manually for every prefab which sucks
You can't set it in OnValidate?
There should at least be a way to do it in the editor. You'd be able to find it in the asset ref drawer code
Another solution would be to wrap the function that you're using to load the assets and keep a global dictionary of asset GUID to object instance ID.
Oh I'm betting there's a way, it's just not something I've explored yet
And I'm hoping you'll do that work for me 😆
I won't, my use case is too small to justify something like this
I already solved it by using two arrays and using find index
Hey i recently uploaded some new addressables to UCD and getting this error
(x1) [Error] RemoteProviderException : Unable to load asset bundle from : https://.../release_by_badge/latest/entry_by_path/content/?path=ServerData/StandaloneWindows64%5Cdefaultlocalgroup_assets_all_de29c5121b885f94cf46c2f23fa8c959.bundle
UnityWebRequest result : ProtocolError : HTTP/1.1 404 Not Found
Problem is because of the %5C but I don't know where that's coming from.
The Addressables were built via Unity Cloud Build service
Also it worked fine before i uploaded new addressbles to UCD
Downgrade Addressables package to 1.18.4 and it worked again 🙃
Anyone has weird 404 errors from CCD today ? they kind of come and go
Hey guys, I have a quick question, how do i identify an addressable key for a built addressable file? is the path to the file on the server, or is the path created for the addressable it file?
Hi!
A while ago, we have published a free version of our upcoming game. Sadly, some percentage of players encountered an issue preventing them from enjoying our product.
As much as I can see inside the logs, the issue is connected strictly to Loading Bundles from addressables and streaming assets. We also discovered that this issue is connected with the game being installed on another drive than C://.
The first error starts with
Exception encountered in operation Resource<IAssetBundleResource>(defaultlocalgroup_unitybuiltinshaders_283fd383eeb0078155f09258ecc8d416.bundle), status=Failed, result= : Invalid path in AssetBundleProvider: 'StreamingAssets/aa/StandaloneWindows64/defaultlocalgroup_unitybuiltinshaders_283fd383eeb0078155f09258ecc8d416.bundle'.
(Filename: C:\buildslave\unity\build\Runtime/Export/Debug/Debug.bindings.h Line: 35)
And then, everything fails with dependencies
Exception encountered in operation Dependencies [defaultlocalgroup_assets_all_b2c60d3cbe697a9a..., sceneassets_assets_all_0bf34bfa1f03de0609b769..., shop_images_assets_all_2e2b6d6cd50a96cc9c620e..., defaultlocalgroup_unitybuiltinshaders_283fd38..., duplicateassetisolation_assets_all_19fdc33a90...], status=Failed, result=System.Collections.Generic.List`1[UnityEngine.ResourceManagement.AsyncOperations.AsyncOperationHandle] : Invalid path in AssetBundleProvider: 'StreamingAssets/aa/StandaloneWindows64/defaultlocalgroup_unitybuiltinshaders_283fd383eeb0078155f09258ecc8d416.bundle'.
(Filename: C:\buildslave\unity\build\Runtime/Export/Debug/Debug.bindings.h Line: 35)
Exception encountered in operation Resource<DataboxObject>(LOCALIZATION.asset), status=Failed, result= : Dependency Exception
(Filename: C:\buildslave\unity\build\Runtime/Export/Debug/Debug.bindings.h Line: 35)
Exception encountered in operation Resource<DataboxObject>(Motor_03_DB.asset), status=Failed, result= : Dependency Exception
(Filename: C:\buildslave\unity\build\Runtime/Export/Debug/Debug.bindings.h Line: 35)
Exception encountered in operation Resource<DataboxObject>(MESSAGES.asset), status=Failed, result= : Dependency Exception
(Filename: C:\buildslave\unity\build\Runtime/Export/Debug/Debug.bindings.h Line: 35)
Exception encountered in operation Resource<DataboxObject>(SCREWS_DB.asset), status=Failed, result= : Dependency Exception
(Filename: C:\buildslave\unity\build\Runtime/Export/Debug/Debug.bindings.h Line: 35)
Exception encountered in operation Resource<DataboxObject>(EXTRA.asset), status=Failed, result= : Dependency Exception
(Filename: C:\buildslave\unity\build\Runtime/Export/Debug/Debug.bindings.h Line: 35)
Exception encountered in operation ChainOperation<DataboxObject> - InitializationOperation, status=Failed, result= : ChainOperation of Type: Databox.DataboxObject failed because dependent operation failed
Dependency Exception
(Filename: C:\buildslave\unity\build\Runtime/Export/Debug/Debug.bindings.h Line: 35)
We discovered a potential solution for our players
-
uninstall the game from steam
-
Delete appdata folder and reinstall on system drive C:
We are out of ideas because all of our PCs run the game perfectly.
Maybe some of you encountered something like this?
Some tech info:
Unity version 2019.4.18f1
Addressables version 1.16.19
HDRP version 7.5.2
We are also using Databox asset and loading some scriptable objects with addressables. But i don't think that's a problem. Clearly something breaks with invalid path.
Cheers
It’s quite possible this is the common issue of the path being too long on windows. Try putting it a few directories deep on your c drives and see if you see the same problem. There are lots of posts about it on the forums.
Oh thanks, i will try it!
But if this is true, how can i fight it?
I believe there was an option in the AddressableSettings, or in the group settings, to shorten the name of the generated bundles. Though I don't know whether that option applies to the built-in shader bundle, which seems to be the problematic bundled one.
On Windows, you always have the risk of running into this. You could say it's a user-error for them trying to install it in a location that is too far of the root of the drive, on the other hand, Addressables-devs should take this into account when generating bundles.
If this still fails, you can also 'hack' into the addressables code and search for the location where the built-in shader bundle is generated and give it a shorter name.
Check the bundle naming mode for groups you have defined. If you use the FileName option, it will generate a name that includes the path from your assets folder, which in many cases will result in a very long name/path for the bundle to load. Using the hash generates a very short name/path.
It's a frustrating issue. Depending on which version of addressables you're using, you could try changing the internal asset naming mode as Jan says. With 1.18 it looks like this:
Isn't it the internal naming mode that matters @shrewd geyser ? maybe I'm wrong about that
@mild flax I don't think the internal asset naming mode is the issue here (those are the names generated in the catalog file itself, I think)
Though, I wouldn't be surprised if it is part of the solution
Yes I think you're right. Though we definitely experience paths being too long way under the windows limit so I think it may be a combo of the internal paths in addition to the main bundle path? Not too sure tbh.
Wow guys, thanks for those tips and help i will try those and i will try to shorten my product name etc to ensure i did everything i could 😄
if anyone is interested, the line that is naming the built in shaders bundle is here
BuildScriptPackedMode.cs : 169
I know this is for addressables but i thought you could help me with this short question:
do you know why the event Application.onLowMemory is being triggered here? Im not even in the warning area
Is it because the OS has just 500MB free?
this happens while the app in foreground btw
@gray lagoon Are you using Addressables in your project?
no, im not, but definitely I'm going to start with it since the project its growing and I'm gonna need it
Im using the resources folder which is causing a lot of memory usage I know. But for the moment I would like to know if whats happening now is concerning
Hmmm, then I have no idea about your current memory issue.
we are testing for months and not gettinng memory crashes
the thing is it doesnt seem a memory issue... the device has more than enough memory for what we are using... but the event is being triggered... so my question is... the event is triggered regardless if the app is using a lot or its just because theres low free memory?
I understand if the OS needs to free memory is going to take down apps in background not the one in foreground
Ah, no idea... I never knew that event existed, so never used it either, so I wouldn't know.
Though I know that iOS seems to indicate double memory usage of a Unity game instead of normal memory usage, but that's only second hand information I have from a friend. I never made a mobile app/game, so I have no experience in debugging or profiling this. :/
I have read that on a unity forum thread, the post was back from 2019 though, not sure if they fixed that
I was merely asking for the Addressables thing because I know that a certain compression method of bundles requires the whole bundle to be loaded and decrompressed in memory, which is significantly more taxing that other methods.
and this wouldnt happen with Addressables I understand?
I understand Addressabkles is the best way to manage memory right now
I don't think so. And I also don't know whether that's a Unity thing, or an iOS thing. But since my friend was using 2020 beta version (not sure if they switched over to 2021)
No idea, tbh.
are you using Addresables?
I am, but I'm devving a PC/Mac game. No experience on mobile
I see, thanks anyway for your help 👍
No problem :)
Though I wish I had something more substantial to add 😅
hehe no prob maybe someone who reads this later could give some hint
Perhaps, but I think you'd have more success in a different channel, because I have the impression it nearly isn't as active as others.
Loading or instantiating by address
You can load or instantiate an Asset at run-time. Loading an Asset loads all dependencies into memory (including Asset bundle data if relevant). This allows you to use the Asset when you need to. Instantiating loads the Asset, and then immediately adds it to the scene.
The default address for an Asset is the path of the Asset. You can change the address to any unique name.
To access an Asset in script using a string address:
Addressables.Load<GameObject>("AssetAddress");
or
Addressables.Instantiate<GameObject>("AssetAddress");
hi! i have a question. if i have a prefab does this mean that it loads automatically all the elements inside of that prefab? does that mean all the elements inside dont need to be addressable? for example i have an animation as an addressable and i load it, does it load all pngs from that animation?
Yes only the root of the prefab needs to be addressed
thanks!
I have a general question for you all : what made you switch to addressable?
I needed a good way to store references to prefabs in my save files and I didn't want to just use the asset name which is fragile
I didn't think about that, that's an excellent reason I will need to consider, I currently reference a unique scriptable object in each thing I need to save which has its own cognitive overhead. so you reference all prefabs with addressablereference (example when you spawn an explosion or a coin)?
Not necessarily all prefabs
Just the ones I need to load from save files
My game is a factory building thing. SO for each machine in my factory, I store its position, rotation, other state etc and also the address of the prefab asset
then when I load the game I can load the prefab from that address, and then position/rotate it appropriately
I see, and their connection is automatically deducted from their position and orientation? or do you maintain references
I maintain separate references for interconnections etc.
gotcha, thanks
Is there there a way to only rebuild modified groups? Currently our build script rebuilds everything each time and it takes forever.
Switch has very strict patch size limits.
I'm on the fence as to whether I'd use Addressables again.
I think I'd defer it until the very end of a project if I do.
can be waved, dunno the conditions though
that's interesting, seems like a lot of work shoehorning, can you elaborate?
Depends how you're using it. The build times I'm complaining about above are an issue for me.
Building in general is flakey
And a bunch of functionality is just broken. Like label filters on references.
Just a waste of time.
It didn't take me that long to go to from resources to addressables. But the overhead of maintaining addressables is annoying. 🤷. I like the scene loading API though.
yeah? how is scene loading better than vanilla?
build time are supposed to be faster according to unity, good to know this another one of those
Build is faster if you don't rebuild your packages, but then you risk not having built packages.
Oh, the other thing is I can no longer build from CLI
the builds just error out when you start
All these things are probably fixable, but I also have a game to make
One thing is you can actually have references to scenes, which is nice. You could probably hack around this with vanilla unity too.
Yep, this is correct, you can get around it but more convenient not to. Also smaller patch sizes are pretty desirable regardless.
yeah i use an inspector thing that does reference
first switch game, I'll chance it. i don't plan to patch 🤣🙈. moving to the next game
that non concurrent async loading though 😅 come on unity
Oh, that's a problem with addressables too
You get deadlocks if you try to load two things at once
you heard it folks, live, from the trenches
Well, to be clear, I regret it because our build is well under 500MB
I am glad to have learned the system, but I acknowledge that it has not been a positive effect on development.
Also if you do want to use addressables I've got a bunch of learning resources for you.
The official docs are lacking
Unfortunately it's one of those APIs where you really need a deep understanding of what's going on to use it
negating their goal
it was supposed to be an easy replacement to resources.load
one thing you just have run into: audio hiccup
I use FMOD in all of my projects
seems to be caused by clip loading
As far as I'm concerned it's the only option for a proper audio system.
any recommendation on removing those?
It's off topic, I'll DM you
Or WWise if you're making bank
I used WWise for a bit. Its editor seems a lot crappier.
FMOD is almost a perfect piece of software AFAICT.
Lol, my partner in technical audio has the opposite opinion 😛
Ah, interesting. Well I'm mostly doing the unity side of things, but FMOD Studio is really nice.
I usually have to research best practises for less computer-savvy audio guy
FMOD is very code-heavy and quite barebones in comparison to wwise is what I hear
Interesting. I think the Unity layer is a bit crappy for FMOD, but you can extend it and fix it.
What I've heard is that premium support for FMOD is lacking.
And Wwise wins there.
Most of FMOD boils down to this:
[SerializeField, EventRef] string _attackAudio;
void Attack() {
RuntimeManager.Instance.PlayOneShot(_attackAudio, transform.position);
}
So I wouldn't call it overly code heavy.
Yeah, though one shots are generally not going to be where difficulty comes in.
I don't know the specifics as I haven't used wwise, all I know is that it's a lot more scalable and fully featured, is much more stable, and the Unity integration doesn't require as much programming. FMOD's editor is more familiar because it looks like more like a DAW, but that limits what it's good for. Though I would never be using anything but FMOD unless I plan into falling into a large company with money 😄
What I like about FMOD the most is that I don't have to use #📦┃addressables lol
Hahaha.
Yeah, the bank system is pretty nice.
Doesn't play super well with webGL though.
Well... requires doing some code that is not properly documented.
IResourceLocator.Locate returns a list of locations
why ?
can it find multiple locations with the same key ?
how do resources.asyncloaded assets get auto unloaded?
want to preload game's frequent assets during title and avoid using addressable 😁
Sure! A label is a key, e.g. Music for your audio files, and would return all the locations to those files.
Only an asset's address is unique in the context of addressables, so such a key would always return a single result
but shouldn't I specify somewhere I am looking for an asset with a specific address, or all assets with a specific label ?
You can, in a certain way.
LoadAssetAsync loads the very first item that matches a key. if only one item matches (i.e. when using the address of an item) it will always be the same item. It the key is a label that matches multiple, it will return the first one.
LoadAssetsAsync would load all matching items and returns a list.
Together with the type parameter T, it (should) filter out unwanted results.
okay, I'm still a bit confused ...
The thing I'm working on is a code that is able to load the game content, some extensions or dlc content, and custom community content (mods). For each of these sources, I have a resource locator instance that I get from loading respective catalog. For each locator, I need to load (or get the resource location to load it) the content - be it some config assets (a single one per mod), or all the game content of a specific type (such as all weapons in the mod).
I still don't know how to group this content (weapons (those being scriptable objects)), whether that's what the groups are for (and how to work with them), whether I should categorize them in their address (like "contentType/content1"), or whether to use the labels you mentioned
my plan was to get all the assets from a catalog, then check their addresses to filter those of the same content type, then use them to get their resource location and use it to load the asset
It's up to you really how you group them together, and how it best fits your project or code structure. You can put all weapons in a group and all armor pieces in a group, or put them all together in a single group, or perhaps put every 'set of equipment' into a group, etc.
They don't really have any difference in terms of loading them in from your code. They do matter in terms of how the assets are packed and stored though. But they can also help in terms of keeping them cleanly separated from a project structure point-of-view.
I do have some doubts about your plan though, as you can't get addresses from the catalog, at least not by default. What do you mean with 'get all the assets from a catalog'? As in, actually loading them in, and then unloading those you don't need?
to get all the addresses
AFAIK, Addressables is a one-way street in terms of Address -> Asset, you can't get Asset -> Address by default, unless you keep a separate log or something that has all of the assets listed with their addresses already.
(I am running behind a few versions though, perhaps they improved that?)
can't you get a list of IResourceLocation's from a catalog with each of them having their primary id? aka 'key' aka 'address' (gah, why couldn't they settle on one name)
you find the json file in the project/build, which is the catalog
you then load the file and let the Addressables class "convert" it into a resource locator
the locator has the Locate method that returns a collection of all resource locations that correspond to the given key
my plan in detail was to get all the addresses from the catalog/locator's Keys property, check each of them to categorize them, get their resource location, and then let the Addressables load assets at those locations
Wouldn't a label work the best in this case then? That basically puts them in a category already and you have the list of resource locations for them by calling Addressables.LoadResourceLocationsAsync("MyLabelA")?
You might have to iterate over the labels you have, but this sounds like what you're trying to do. You can save the returned list of resource locations in the categories you plan to store them in at run-time.
that might be the best, yes ...
I am a bit hesitant about the label, because it evokes me to see it as some sort of "helper tag"
Good thing in this case you can apply multiple labels per item. :)
I can ?
As opposed to the GameObject label system in the inspector :)
Yes! :)
that changes a lot ...
okay, thanks for the help, hopefully I'll get somewhere further
E.g., we tag everything with NightFever to denote content related to our DLC packs.
wouldn't groups and profiles be better for dlc builds ?
Yes, we have those as well. But we use these, for example, to add icons in the UI to say these are from a DLC pack.
can scenes loading be interrupted when using addressables?
and also can scene loaded be discarded to load another one without having to activate the scene?
Do you mean that you are able to cancel it? Or that it can be interrupted by an event/ error?
No, loading a scene is blocking until it is activated. When a scene is done loading but not activated, it will stall any subsequent loading.
alright thanks, i never understand that part
It's a Unity-thing. Not an Addressables-thing specifically. All(?) async operations are halted when a scene is pending activation
and other assets don't have that activation so one can stop async mid loading ?
hey guys, is it possible to upload an Asset (including name, group and label) to a given catalog remotely?
like AddressableAssetEntry = AddressableAssetSettings.CreateOrMoveEntry() which is a local Editor thing
Btw with remotely I also mean in a different project (project A); there's a project B which hosts assets and the catalog and project A can access those assets remotely, however, I also want project A to be able to send its own assets to the same catalog
how to use ScriptableObject to save reference to a game object ?
next time I can load the ScriptableObject and ref the object.
@gentle knoll Are you using the Addressables package? Or is this 'vanilla' Unity related? Because I saw you post the same question in #archived-code-general.
Depends on what you mean by 'a reference to a game object', since that's a thing in addressables... However, the solution proposed in #archived-code-general is probably what you're looking for since Addressables brings some additional complexity with it.
@gentle knoll Don't crosspost questions.
Is it possible to use methods/classes from UnityEditor.AddressableAssets (mainly from AddressableAssetSettings and AddressableAssetEntry) outside of the Editor? I wanna be able to update catalogs in play mode
Nope. Maybe there's another way to achieve what you want? Why do you want to update the catalogs?
Basically I want to have some kind of asset storage server, whose assets can be accessed by multiple independent projects through the catalog
And I also want some clients to be able to add new assets to that catalog
I was thinking about using the UnityEditor methods through batch mode if the only way to build is through the Editor
The first part is doable - it's supposedly designed with that use-case in mind (though I'm not too impressed with the current state). As for adding new assets, as e.g. shaders need to be compiled (amongst other things) when creating bundles, it has to all be done through editor. Batch mode with Unity installed could work if your use-case supports it obviously.
yeah, accessing and loading assets from a remote catalog wasn't a problem; however, I haven't been able to generate a build (both from Editor as from a script) while having a script using UnityEditor.AddressableAssets, as when I press the build button I get this error in the console:
The type or namespace name 'AddressableAssets' does not exist in the namespace 'UnityEditor' (are you missing an assembly reference?)
I tried to switch the Addressables package version to 1.16.19 (verified), 1.17.17 and 1.18.9 (latest) and the problem persisted
oh it seems the script must be inside an 'Editor' folder
Hi people!
I've been trying to get the pre-release localization package working. I could create locales, string tables etc. However, when I try to code a simple button press (following the tutorial) I've got using UnityEngine.Localization; and still it gives me an error on compile saying:
\LocButtonManager.cs(16,19): error CS0103: The name 'LocalizationSettings' does not exist in the current context
Any ideas? :/
Ye ok. I was following a really outdated tutorial and found the new one. Sorry.
Hello.
Hey anyone know if you can separate catalogs, I am trying to make DLC, it seems like everything is built into one catalog lol
Does anyone know how to convert Resources.LoadAll to Addressables system?
I've posted a question here: https://gamedev.stackexchange.com/questions/194314/how-to-convert-resources-loadall-to-addressables
The docs mention labels, but not much else on how it can be done.
@rigid shadow You can find this case specifically explained in the manual https://docs.unity3d.com/Packages/com.unity.addressables@1.18/manual/AddressableAssetsMigrationGuide.html#the-resource-folders-method
Other resources pinned in this channel as well.
In the case of Resources.Load, there is a very specific explanation of how to convert to Addressables. However for Resources.LoadAll, it is vaguely explained that it needs to be done using Labels but I couldn't find a concrete example anywhere. Would you be kind enough to direct me towards a more specific resource?
Manual should have examples how to use labels.
It works the same, it loads entire group under the same label
If I only wanted to load YAML files, does that mean I'd have to specifically label every single YAML file manually?
You can add entire directories under a label
I know, but some of the files in the directory aren't YAML files. Is there a way to ignore them or select only the ones I want? I'm pretty sure LoadAll() did that by checking for type?
E.g. I have a YAML file, and in that same directory, a sprites folder with images
Just open Addressable Groups manager in Unity, it will become quite obvious how to manage groups. They can easily be selected sorted and assigned
I'll give it go. Thank you! 😊
@cedar loom You might want to check out this thread: https://forum.unity.com/threads/building-multiple-catalogs.1053224/
I struggled too creating multiple catalogs specifically for DLC packs. It requires a bit of diving into the source code of Addressables itself though, as there seems to be no disk/build-efficient way to create DLC packs by default.
@shrewd geyser read this, its too complicated, I think it's best if I just create separate projects for now as a work around
Does anyone know why you can Instantiate without loading any of the Catalogs? and if you go that route what the problems could be? I find it strange that it automatically loads the catalog's some how without you first initializing Addressables.LoadContentCatalogAsync(path);
Hmmm doesn't look like addressable work :S, I am expecting that, the bundle file contains all the required information or data....w
Hi. I'm using localization with remote addressables. But I'm wondering if I can use a local content bundle for Localization if remote connection is failed or player has no internet connection? Is it possible?