#📦┃addressables

1 messages · Page 7 of 1

honest halo
#

If you load many asset locations with a tag then you can know how many

fringe frost
honest halo
fringe frost
#

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.

honest halo
#

Addressable entries can be modified with code in edit mode

fringe frost
wide plinth
#

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

honest halo
#

Asset bundles have many dumb issues

north thistle
#

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?

honest halo
north thistle
honest halo
north thistle
#

I feel like this can spiral into hundreds of groups

honest halo
north thistle
#

thanks!

unreal garnet
#

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?

north thistle
#

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 ?

honest halo
# unreal garnet Hey everyone, I’m running into a weird Addressables issue and would love some in...

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

honest halo
unreal garnet
# honest halo If the catalog and remote bundles are rebuilt later by a different clone of the ...

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. notlikethis

honest halo
#

Our bundle organisation for remote bundles meant we could just use group name only

north thistle
#

so im a bit confused with the difference between it and normal scene

#

something like this

honest halo
# north thistle 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

north thistle
#

thanks!

north thistle
honest halo
#

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.

unreal garnet
honest halo
north thistle
#

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?

north thistle
#

If i use pack seperately like this, the whole Sylphy folder will be in one bundle, right?

north thistle
plain terrace
#

in fact, I have a "character catalog" just like you do :p

plain terrace
trail crow
#

has this issue been solved in 2025?

north thistle
#

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

devout barn
#

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?

honest halo
devout barn
jovial solar
#
{
    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?
jovial solar
#

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

honest halo
jovial solar
# honest halo Use a debugger to see if it gets past the while loop I would also recommend asyn...

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);
    }
}```
jovial solar
#

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?

honest halo
#

handles are structs so cannot be null.
must be that the handle was already used up

final pewter
#

are addressables included in the build

#

and what exactly are they

#

i've tried reading things and it's still unclear

honest halo
final pewter
coral scarab
#

i'm trying to get my first addressables to work

honest halo
#

also wtf are you doing with asset paths this will only work in editor

#

You have miss understood some critical things

coral scarab
#

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

honest halo
#

If this is editor code you dont want to use addressables
If this is runtime code then you need to do this compleatly differently

coral scarab
#

this can run on another thread

honest halo
#
ItemSO someItem = await Addressables.LoadAssetAsync<ItemSO>("MyItemAddress");
honest halo
#

It will throw an exception explicitly stating that fact

coral scarab
#

then why even use "Load ASYNC"?

#

if it's just gonna give an error for being on another thread

honest halo
#

Async does not automatically mean other threads

coral scarab
#

oh

honest halo
#

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

coral scarab
#

so how would i do this correctly then? I am just tryig to load scriptable objects by addressables

honest halo
#

JS promises are the same, im sure you know JS has no threading without workers right?

coral scarab
#

no, i always assumed it used another thread to do it or something

honest halo
coral scarab
#

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

honest halo
#

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

coral scarab
#

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?

coral scarab
#

this works now

honest halo
honest halo
coral scarab
#

oh nice

dim aspen
#

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

honest halo
dim aspen
honest halo
#

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

dim aspen
honest halo
#

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

dim aspen
#

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

honest halo
#

Or invest in automating making assets addressable and organising this instead

dim aspen
#

I could, and probably would, but I wanted a minimal effort fix in this project situation.

honest halo
#

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

dim aspen
#

It's not perfect by any mean

honest halo
#

really its not hard to get asset dependencies, check what has addressable entries or not and correct this

dim aspen
#

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 ?

honest halo
#

i wonder anyway goodluck

dim aspen
#

I will certainly need some. Thanks

faint python
#

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

tall echo
# faint python Hi everyone, I am making a prototype with unity's addressables My addressable b...

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).

coral scarab
#

I can't seem to figure this out, I need to get a set of sprites in this bundle

honest halo
#

the point of addressables is to not work directly with asset bundles

faint python
#

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

coral scarab
honest halo
coral scarab
#

Ok I understand

coral scarab
#

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

coral scarab
#

i'm just going to property assign these.

honest halo
#

If using asm Def's add the UniTask addressables one to references

hexed sparrow
#

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.

honest halo
#

Should work the same for all asset dependencies, if all users are released the dep can be too

hexed sparrow
honest halo
hexed sparrow
#

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.

honest halo
#

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.

hexed sparrow
#

I'm sure I'm missing something. Understanding how assets which aren't related to addressables end up unloaded is perplexing though.

honest halo
#

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

hexed sparrow
#

Yeah that's my understanding.

honest halo
#

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

hexed sparrow
#

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.

honest halo
#

That cant be true. Scenes in your normal scene build list would have all their dependencies in build. There cannot be any crossover

hexed sparrow
#

Aye, that's my understanding.

#

The behavior is perplexing.

honest halo
#

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

hexed sparrow
#

Appreciate your input, and providing a sanity check.

honest halo
#

One day perhaps asset bundles will get the love they deserve

hexed sparrow
#

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.

honest halo
#

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

hexed sparrow
#

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.

honest halo
#

that helps!

honest halo
#

<@&502884371011731486>

wicked prairie
#

can I set an AssetReferenceGameObject in code or do I have to drag in the prefab in the editor for each?

wicked prairie
#

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

honest halo
wicked prairie
#

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

honest halo
#

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)

wicked prairie
#

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?

honest halo
wicked prairie
#

Yes, but don't I also store the asset reference in the SO?

honest halo
#

Yes that part is correct too

wicked prairie
#

ok and how do I set the asset reference?

honest halo
#

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

wicked prairie
#

that's what my question was

honest halo
#

The point would be to make the assets and assign the data and then you just use the assets as is

wicked prairie
#

I understand, thank you.

unreal garnet
#

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?

harsh flax
#

<@&502884371011731486>

honest halo
native frost
#

Is it advisable to preload all of your addressables that you will need in a level?

honest halo
warm lynx
#

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.

honest halo
warm lynx
honest halo
#

What unity version is this? They look fine to me

#

Try clearing the past clear data + cache and do a new full build now

warm lynx
#

Unity 6.0.59f2, and addressables 2.7.3

honest halo
#

you may be able to update the package btw

warm lynx
#

Clean cache no change. I'm always a bit wary of speculative package updates but I'll give it a go.

#

No change.

honest halo
#

What if you make a new local group and move them there?

warm lynx
#

Deleted the group, created a new one with default settings, and added the images to that. No change.

#

Yep, that 🙂

honest halo
#

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

warm lynx
#

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.

honest halo
#

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

warm lynx
#

In this image _01 is set to a sprite mode of multiple and _02 is set to single

#

no other differences

honest halo
peak kraken
#

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?

honest halo
upbeat dagger
#

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

upbeat dagger
#

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

honest halo
#

Addressables handles the shader stuff and should have a bundle for shaders

upbeat dagger
#

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?

honest halo
#

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)

upbeat dagger
#

Interesting. I'll try

upbeat dagger
#

Is it possible to bundle a scene with baked lighting?

honest halo
upbeat dagger
#

good to know, thanks a bunch

floral vale
#

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.

honest halo
floral vale
#

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

honest halo
tired garnet
#

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.

honest halo
tired garnet
#

Using GetDownloadSizeAsync right?

honest halo
tired garnet
# honest halo Yes

What about in WebGL, I tried using it but GetDownloadSize always not zero even if it's built-in streaming assets.

honest halo
tired garnet
#

AHhh Yeah, I realize that, Server and Client in Web Dev setup confused me

crystal falcon
#

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 :/

honest halo
crystal falcon
honest halo
honest halo
# crystal falcon 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?

crystal falcon
#

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

honest halo
crystal falcon
honest halo
#

assets in a Resources/ folder are always accessable

#

the project settings for this tool is likelly a scriptable object in project somewhere too

#

Maybe that will help i dunno. Ive used addressables a lot so I can help with that but not this other tool

crystal falcon
honest halo
#

As in addressables we can configure per group its load location (in build or outside the build or even online at a URL)

crystal falcon
#

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?

honest halo
#

You need to understand how to use addressables yourself then because thats crutial to actually do this properly

#

It must try to find load something with an address like this and if you give things the address it expects then it works

crystal falcon
# honest halo

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

honest halo
#

You are trying to shove together 2 things without understanding how it could even work

crystal falcon
honest halo
#

Did naninovel put these in this group for you?

#

Do these work ?

crystal falcon
honest halo
#

so do these work?

crystal falcon
#

And this error don't says to much

honest halo
#

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

crystal falcon
honest halo
honest halo
#

You can try loading the asset via addressables manually to sanity check

#

but im out of ideas after this point

crystal falcon
#

A question:
This files, how can I retrieve once I created the bundle?

honest halo
#

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

sinful rampart
#

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?

honest halo
#

go find the file in windows file explorer

#

also wrong channel no idea why you picked this one

sinful rampart
#

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

honest halo
#

ask in the blender server for help with blender

crystal falcon
honest halo
# crystal falcon 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

unreal delta
#

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...

honest halo
#

The best solution for me in the past was to have everything in addressables

#

i basically ditched Resources

unreal delta
honest halo
#

Again I have no idea why unity made this design decision. Seems fine to me to allow build to/from bundle references

upbeat dagger
#

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

unreal delta
#

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?

unreal delta
#

I mean I had to delete library and obj

honest halo
unreal delta
#

All packages are up to date

unreal delta
unreal delta
#

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

feral canyon
#

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)?

honest halo
native frost
#

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.

honest halo
#

If its a dep at bundle build time then thats that

native frost
#

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?

honest halo
native frost
#

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.

honest halo
native frost
#

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. notlikethis

honest halo
random bronze
#

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.

honest halo
#

These are meant to be additional

random bronze
honest halo
#

your catalog

random bronze
#

The catalog from the base game?

honest halo
#

You do not want users to modify that one.
Yes

random bronze
#

So basically just disable build remote catalog? I only enabled that while trying to fix the issue at hand

honest halo
#

Yea do that first and then see about loading an additional one

random bronze
#

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

honest halo
random bronze
#

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.

tranquil fog
#

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?

honest halo
tranquil fog
honest halo
tranquil fog
honest halo
wicked prairie
#

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}");
            }
        }
    }
honest halo
wicked prairie
#

alright thanks

grim cargo
brittle quartz
#

same here

#

checked on LibreWolf and Chrome

wicked prairie
honest halo
#

UniTask is better than Awaitable and should be used ideally

wicked prairie
#

Interesting

#

cool thanks

wicked prairie
#

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

honest halo
#
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

wicked prairie
honest halo
#

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

wicked prairie
#

awesome, thank you

tiny swan
#

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?

tiny swan
#

Fixed it by deleting them + their schemas and running analyze rules after that

upbeat dagger
#

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

#
  1. 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
  2. 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"...
  3. So naturally I automated this in my bundle loader.... this was my mistake
undone thistle
#

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

upbeat dagger
#

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.

honest halo
#

So it's not possible to test unless you swap to the platform your editor is running in

#

So windows Mac or linux

upbeat dagger
#

I see! Ty.

naive totem
#

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?

honest halo
wicked prairie
#

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;
    }
honest halo
# wicked prairie it's a GameObject inside of the function but when returned its a UniTask<GameObj...

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

Creates a continuation that executes asynchronously when the target Task completes.

#

If you want to learn more then research how async works in c# normally. UniTask better matches Task so that should make sense more

wicked prairie
#

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

honest halo
#

The two options above are how we can get the object once the task is actually done in the future

wicked prairie
#

oh I see

#

I think I get it, thanks

honest halo
# wicked prairie oh I see

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!

wicked prairie
#

yeah it was complaining because I had it inside a return void event but I think I just needed to change it to UniTaskVoid

honest halo
#

make sure you use .Forget() with these!

wicked prairie
#

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?

honest halo
# wicked prairie how do I actually do that for an event

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.

wicked prairie
honest halo
wicked prairie
#

ah so that's how

#

thanks

honest halo
wicked prairie
#

good idea

slender pivot
#

Is this channel (addressables) something you use if you want to add modding support for your game?

hollow token
#

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?

wicked prairie
#

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

honest halo
#

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

honest halo
#

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 😐

wicked prairie
#

so I'll just do release instead of destroy?

#

or do both?

honest halo
#

Do you understand the two difference scenarios I stated?

wicked prairie
#

I think so

honest halo
wicked prairie
#

Thank you, I will try that

upbeat dagger
#

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?

upbeat dagger
#

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:

  1. Lightmaps appear in the scene but UVs are very wrong and wonky
  2. Light Probes are not functioning at all.
upbeat dagger
#

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.

hollow token
#

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?

hollow token
#

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

teal mortar
hollow token
#

Is possible to build a bundle for Windows without changing to that platform? So my editor could work

teal mortar
#

that is the way to build the bundles for windows, basically

hollow token
#

I mean, without doing "Switch platform". That takes ages

teal mortar
#

if you need to switch back and forth a lot it can be worth making a separate checkout of your project for each platform!

hollow token
#

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?

honest halo
#

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

upbeat dagger
#

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

lilac linden
#

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.

teal mortar
lilac linden
lilac linden
#

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.

honest halo
lilac linden
#

Ohh, makes sense. Thanks!

upbeat dagger
#

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

hollow token
#

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 🤔

hollow token
#

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?

hollow token
#

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? 🤔

honest halo
#

Not sure what else you may mean

hollow token
# honest halo 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.

honest halo
#

If manually loaded it needs to be released manually

hollow token
#

Ups, I mean LoadSceneAsync not LoadAssetAsync (just fixed my example)

#

Is still wrong @honest halo ?

hollow token
#

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?

honest halo
#

Some of this is a fucking mess it's sad how this can't do this stuff for you

hollow token
#

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

honest halo
hollow token
#

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?

hollow token
#

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

honest halo
hollow token
#

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...

honest halo
wicked prairie
#

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?

mint lark
#

You can do a List<GameObject>

mint lark
wicked prairie
# mint lark 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

mint lark
#

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

wicked prairie
mint lark
#

Yeah, like a Dictionary<int, GameObject> prefabs would work as well

wicked prairie
#

alright thanks, I'll see if I can use that

mint lark
#

Yeah

honest halo
#

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

wicked prairie
#

I think it will be best to not use them

honest halo
wicked prairie
#

I thought it would be a lot easier

honest halo
wicked prairie
honest halo
#

as long as the scriptable object is addressable then that works

wicked prairie
# honest halo if you prefer, it was just an example

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

honest halo
#

the downside is that these would be loaded in memory forever

wicked prairie
#

yes

#

I can't use any async methods with mirror

honest halo
#

hence loading them ahead of time

#
GameObject asset = await Addressables.LoadAssetAsync<GameObject>("CoolPrefab");
AddPrefab(asset);

StartServer();
wicked prairie
#

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

honest halo
#

The only solution is a custom prefab provider that can load things in a special way but no idea if these support async either

wicked prairie
#

I was gonna have a SO for each character and a dictionary of SOs from which I instantiate when needed

honest halo
#

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

wicked prairie
#

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

honest halo
wicked prairie
#

I see

#

I thought it just keeps a reference until the asset is needed

#

but that makes sense in a way

honest halo
#

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

wicked prairie
#

so I instantiate all the addressables, then register them like that at the start right?

honest halo
#

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

wicked prairie
honest halo
#

ive said it a few times you LOAD THE PREFAB ASSET

#

its not the same as instantiation

wicked prairie
#

yeah ok

#

I said instantiate because thats what the other person said

honest halo
#

then they are wrong

wicked prairie
#

alright

honest halo
#

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

wicked prairie
#

ok so load and later spawn, no instantiation

honest halo
#

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

wicked prairie
#

ok thanks

#

I'll see what I can do

fast lily
#

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

edgy heath
#

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!

honest halo
honest halo
naive totem
honest halo
#

Do share an example if possible

fast lily
fast lily
honest halo
#

Check the network tab in your browser debugger to see if the bundles download all together

fast lily
#

i belive web has limit on concurrent load request

honest halo
#

again you can debug this in browser

fast lily
#

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

honest halo
fast lily
#

i have a similar idea
wanna implement it and take a look

fast lily
#

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

prisma latch
#

Hey.i got a question, to load maps should I use addressables to load the whole scene or just the environment prefab

steady mica
#

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

honest halo
honest halo
#

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

steady mica
honest halo
steady mica
steady mica
#

cuz I'm interested

honest halo
#

This content cannot reference the main content however due to being compleatly separate

granite axle
#

Can anyone guide me for simplest way to getting started with addressable ?

trail crow
#

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:
    1. initialize addressables/catalog
    2. preload map/scene label dependencies
    3. load/activate gameplay scene
    4. start game/session runner
    5. runtime systems load required content assets through addressables
    6. 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 OnDestroy insufficient 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 + WaitForCompletion guard 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
honest halo
#

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)

spark robin
#

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}'");
        }
spark robin
#

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);
            }
wicked prairie
#

they must be instantiated

trail crow
hollow token
#

How can I figure out at runtime if a project is using Addressables?

steady mica
hollow token
# steady mica 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...

steady mica
hollow token
steady mica
#

like here, i know my game has addressables in it

hollow token
#

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.

honest halo
#

Is this for modding? Sounds sus

hollow token
#

The data is a list of scriptable objects actually

honest halo
hollow token
#

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.

honest halo
strange wasp
#

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

hollow token
scarlet pulsar
#

Ask questions and discuss anything to do with Unity's Addressable Asset System!

tidal dawn
#

whats an addressable

hexed shell
languid widget
#

Literally explained on the first page of the linked manual.

#

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...

deep veldt
#

Guess what idiot?

#

I read the same page you did

languid widget
#

Also the entire blog post right there dedicated to how to not to pack everything together

deep veldt
#

But you said you read it three times

languid widget
#

Vertx, a good candidate to add to pins, explaining how to pack things separately as well.

deep veldt
#

If only you could read many things

#

Who'da thunked it

languid widget
#

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.

robust elbowBOT
#

dynoSuccess Twiner#8757 was muted

mystic jackal
#

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.

languid widget
mystic jackal
#

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.

hexed shell
#

Well, you can do that too, just don't be surprised if you're referred to the manual

mild flax
#

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?

mystic jackal
#

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.

languid widget
mild flax
languid widget
#

Yea, sorry I don't have personal experience with remote deployment even. Maybe someone else has.

low halo
#

Oh sweet an Addressables channel!

obsidian delta
#

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?

queen imp
#

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.

twin sparrow
#

these are the questions I expected to see here lol

queen imp
#

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.

wraith edge
#

I recommend putting this up on the forum if you haven't already. Odds are the right people won't see it here.

queen imp
#

Will do

steep wigeon
#

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".

flint agate
#

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.

urban sorrel
strange bear
#

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

dense forum
#

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..

spice latch
#

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)

strange bear
strange bear
#

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...

strange bear
harsh jackal
#

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?

steep wigeon
deft pulsar
#

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.

mild flax
mild flax
# harsh jackal hello guys, want to ask about the Addressable Asset Bundle. How do I retrieve t...

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

drowsy sluice
#

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?

deft pulsar
# mild flax FYI you can mark a folder as addessable if that helps

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.

mild flax
mild flax
deft pulsar
barren sparrow
#

Hey everyone

Does anyone know how to upload OSX and windows addressables to CCD?
Or do i need a different bucket per platform?

mild flax
barren sparrow
#

@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

mild flax
barren sparrow
#

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

mild flax
barren sparrow
#

@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

mild flax
barren sparrow
#

Great. It's uploaded.
So not sure why Unity can't load it 🤔

mild flax
#

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

languid widget
#

@barren sparrow No reaction gifs, please.

barren sparrow
#

@languid widget Noted! Sorry!

barren sparrow
#

@mild flax Rebuilding with the new path worked!
Thanks 🙂

drowsy sluice
# mild flax fyi I think `?path=/catalog_2021.05.15.23.43.32.hash` should be `?path=ServerDat...

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?

barren sparrow
#

@drowsy sluice no / at the end. i learned that buy trying it with a / and it resulted in //catalog_....

drowsy sluice
#

great, thanks, I'll give it a try

cunning orchid
# barren sparrow Ah right. I'm using Unity Cloud Build to create my builds (include addressables)...

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/

GameDev Resources

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.

elfin lagoon
#

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?

languid widget
#

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.

elfin lagoon
languid widget
#

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.

drowsy sluice
#

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

paper marsh
#

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

strange bear
#

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 :/

strange bear
#

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

real raven
#

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)

untold warren
lament ivy
#

how do you guys get a list of all the assets loaded in a scene?

#

before even using addressables (i avoid that thing)

novel aurora
#

There are several plugins for it or you just keep track of it yourself in a List or what not

ivory magnet
#

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 👍

low halo
#

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? 🤔

ivory magnet
#

yeah if you are using addressables for scenes, they should be removed from the build settings (and therefore don't have a buildIndex)

ivory magnet
# low halo You don't need to use Addressables for the reload

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

peak forum
#

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:

  1. Build NewBuild
  2. Upload it to the cloud
  3. 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)
  4. Change for example a color of sprite in one addressables prefab
  5. Update a Previous Build
  6. Remove what's stored in the cloud and upload updated assets
  7. 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 😔

south whale
copper lichen
#

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)

peak forum
low halo
#

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

ivory magnet
# copper lichen Does anyone know how to get the addressable ID from a loaded instance of an asse...

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)

https://forum.unity.com/threads/how-to-check-if-scene-is-already-loaded-when-using-addressables-loadsceneasync.1000139/

copper lichen
copper lichen
low halo
#

because currently I have to set it manually for every prefab which sucks

copper lichen
#

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.

low halo
#

And I'm hoping you'll do that work for me 😆

copper lichen
#

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

barren sparrow
#

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

barren sparrow
#

Downgrade Addressables package to 1.18.4 and it worked again 🙃

slate timber
#

Anyone has weird 404 errors from CCD today ? they kind of come and go

late fractal
#

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?

dense forum
#

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

mild flax
dense forum
#

Oh thanks, i will try it!

dense forum
shrewd geyser
# dense forum 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.

mild flax
#

Isn't it the internal naming mode that matters @shrewd geyser ? maybe I'm wrong about that

shrewd geyser
#

@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

mild flax
dense forum
#

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
gray lagoon
#

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

shrewd geyser
#

@gray lagoon Are you using Addressables in your project?

gray lagoon
#

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

shrewd geyser
#

Hmmm, then I have no idea about your current memory issue.

gray lagoon
#

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

shrewd geyser
#

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. :/

gray lagoon
shrewd geyser
#

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.

gray lagoon
#

and this wouldnt happen with Addressables I understand?

#

I understand Addressabkles is the best way to manage memory right now

shrewd geyser
shrewd geyser
gray lagoon
#

are you using Addresables?

shrewd geyser
#

I am, but I'm devving a PC/Mac game. No experience on mobile

gray lagoon
#

I see, thanks anyway for your help 👍

shrewd geyser
#

No problem :)
Though I wish I had something more substantial to add 😅

gray lagoon
#

hehe no prob maybe someone who reads this later could give some hint

shrewd geyser
#

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.

heady trout
#
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?

low halo
heady trout
#

thanks!

lament ivy
#

I have a general question for you all : what made you switch to addressable?

low halo
lament ivy
low halo
#

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

lament ivy
low halo
lament ivy
#

gotcha, thanks

copper lichen
#

Is there there a way to only rebuild modified groups? Currently our build script rebuilds everything each time and it takes forever.

copper lichen
#

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.

lament ivy
lament ivy
copper lichen
#

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.

lament ivy
#

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

copper lichen
#

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

copper lichen
copper lichen
lament ivy
lament ivy
copper lichen
#

Yeah, if you're under 500MB you're sweet anyway

#

I regret doing it

lament ivy
#

that non concurrent async loading though 😅 come on unity

copper lichen
#

Oh, that's a problem with addressables too

#

You get deadlocks if you try to load two things at once

lament ivy
copper lichen
#

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

lament ivy
#

negating their goal

#

it was supposed to be an easy replacement to resources.load

#

one thing you just have run into: audio hiccup

copper lichen
#

I use FMOD in all of my projects

lament ivy
#

seems to be caused by clip loading

copper lichen
#

As far as I'm concerned it's the only option for a proper audio system.

lament ivy
#

any recommendation on removing those?

copper lichen
#

It's off topic, I'll DM you

lament ivy
#

the external sdk? not the built in one right

#

👌

hexed shell
copper lichen
#

I used WWise for a bit. Its editor seems a lot crappier.

#

FMOD is almost a perfect piece of software AFAICT.

hexed shell
#

Lol, my partner in technical audio has the opposite opinion 😛

copper lichen
#

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

hexed shell
#

FMOD is very code-heavy and quite barebones in comparison to wwise is what I hear

copper lichen
#

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.

hexed shell
#

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 😄

copper lichen
#

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.

spice latch
#

IResourceLocator.Locate returns a list of locations

#

why ?

#

can it find multiple locations with the same key ?

lament ivy
#

how do resources.asyncloaded assets get auto unloaded?

#

want to preload game's frequent assets during title and avoid using addressable 😁

shrewd geyser
#

Only an asset's address is unique in the context of addressables, so such a key would always return a single result

spice latch
#

but shouldn't I specify somewhere I am looking for an asset with a specific address, or all assets with a specific label ?

shrewd geyser
#

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.

spice latch
#

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

shrewd geyser
#

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?

spice latch
#

to get all the addresses

shrewd geyser
#

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?)

mild flax
#

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)

spice latch
#

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

shrewd geyser
#

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.

spice latch
#

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"

shrewd geyser
#

Good thing in this case you can apply multiple labels per item. :)

spice latch
#

I can ?

shrewd geyser
#

As opposed to the GameObject label system in the inspector :)

shrewd geyser
spice latch
#

that changes a lot ...

#

okay, thanks for the help, hopefully I'll get somewhere further

shrewd geyser
#

E.g., we tag everything with NightFever to denote content related to our DLC packs.

spice latch
#

wouldn't groups and profiles be better for dlc builds ?

shrewd geyser
#

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.

lament ivy
#

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?

shrewd geyser
shrewd geyser
lament ivy
shrewd geyser
#

It's a Unity-thing. Not an Addressables-thing specifically. All(?) async operations are halted when a scene is pending activation

lament ivy
odd delta
#

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

odd delta
#

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

gentle knoll
#

how to use ScriptableObject to save reference to a game object ?
next time I can load the ScriptableObject and ref the object.

shrewd geyser
#

@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.

gentle knoll
#

no

#

not addressables

#

is the Addressable a better way to do it ?

shrewd geyser
#

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.

wraith edge
#

@gentle knoll Don't crosspost questions.

odd delta
#

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

mild flax
odd delta
#

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

mild flax
#

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.

odd delta
#

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

shut gorge
#

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.

long escarp
#

Hello.

cedar loom
#

Hey anyone know if you can separate catalogs, I am trying to make DLC, it seems like everything is built into one catalog lol

rigid shadow
#

Does anyone know how to convert Resources.LoadAll to Addressables system?

#

The docs mention labels, but not much else on how it can be done.

languid widget
#

Other resources pinned in this channel as well.

rigid shadow
languid widget
#

Manual should have examples how to use labels.

#

It works the same, it loads entire group under the same label

rigid shadow
#

If I only wanted to load YAML files, does that mean I'd have to specifically label every single YAML file manually?

languid widget
#

You can add entire directories under a label

rigid shadow
#

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

languid widget
#

Just open Addressable Groups manager in Unity, it will become quite obvious how to manage groups. They can easily be selected sorted and assigned

rigid shadow
#

I'll give it go. Thank you! 😊

languid widget
shrewd geyser
#

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.

cedar loom
#

@shrewd geyser read this, its too complicated, I think it's best if I just create separate projects for now as a work around

cedar loom
#

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);

cedar loom
#

Hmmm doesn't look like addressable work :S, I am expecting that, the bundle file contains all the required information or data....w

meager grail
#

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?