#📦┃addressables

1 messages · Page 9 of 1

olive plover
mild flax
#

Have you tried running the tests here?

#

First thought is it might be worth looking in the 'top level settings' and seeing if you have build remote catalog enabled? It looks like it's trying to get the package locally.

olive plover
mild flax
olive plover
uneven onyx
# mild flax Have you tried running the tests here?

yes - that's what I'm talking about. After running those tests you get duplicate bundle dependencies, but it's hard to figure out what is actually causing the duplication. There are assets in there that I don't think are actually referenced by things in the bundle

unique beacon
#

Hi everyone.
I'm having an issue with Addressable.LoadSceneAsync in build.
The AsyncOperationHandle seems to be stuck at 45% while it works well in Editor PlayMode.
(for info, I'm running on Unity 2021.1.22 and Addressables 1.18)

#

does anyone have any idea why that happens ?

unique beacon
#

A little more in-depth :
the AsyncOperationHandle.Task seems to be stuck in WaitingForActivation status, thus preventing completion.
I've yet to figure out why the Task is not activated...

unique beacon
#

Found out by using WaitForCompletion that it is stuck on AssetBundleProvider.GetAssetBundle
More precisely on m_AssetBundle = (m_RequestOperation as AssetBundleCreateRequest).assetBundle; (l.305)

thorny bay
#

hello, new to addressables just instaled the package on my project but i can't find the name space

#

already tried updating visual studio

#

i already made some assets addressable so it's defiantly installed

unique beacon
#

@thorny bay Are you using vscode, or vs 20xx ?
Is that error showing in Unity console too ?

I had the same error on vscode at some point, omnisharp did not seem to get the symbols loading.

If you don't have that error in Unity console but have other issues for compilation, fix those and it should regenerate the project files with the symbols for vscode to work with.

thorny bay
#

I fixed it by deleting csharp files in the project

#

and then rebuilding the project in vstudio

#

thanks tho 🙂

unique beacon
uneven onyx
#

Is there any way to set a field on an object created using AssetReference.InstantiateAsync before Start is called on it? In my tests, Start gets called before control is returned to the code calling InstantiateAsync

fathom jackal
#

is there anyone i can screen share with and ask some questions about adressables

#

and their enormous size

#

i think i may have duplicate assets

untold warren
#

assets which you think are duplicated, mark them as addressables aswell

vague oar
#

Hello Team Unity, we are using addressable in our game with voxel play. The issue is that if I add any asset as addressable it has dependency files with voxel play. If I try to add voxel play files as addressable it won't allow me to do because it's assets are located in resource folder and I can't move that out of resources folder it won't work. What would be the ideal solution for this issue?

odd junco
#

Hi!
I'm Andrea, from Rortos (an italian game development studio).
We are working on a project using Asset Bundles.
We are having problem with Caching.ClearCahce() function. It returns false.
So we have tried to use GetAllCachePaths() to manually clear all caches.
Every single cache returns true except for one: scenes cache.
Why ClearCache always fail on cache which contains scene objects?
Have you ever seen this problem?

mild flax
#

I could be wrong but I think Caching.ClearCache returns false even when it succeeds? At least I think it seems to work reliably for us when it comes to actually clearing the cache.

odd junco
mild flax
odd junco
#

We are using Unity 2020.3.19f1 (LTS).
We are seeing this problem running in UnityEditor

mild flax
#

The main reason I can think of that it would fail to clear the cache is if it thought the assets were still in use. I guess that doesn't help much though.

odd junco
#

The problem seems to be related to cache size.
If cache is too small and you try to download something bigger, the ClearCache will fail.
I think it's a bug, don't know if it's an only editor bug

fresh stream
#

Is there a good way to share the same asset group between a client and server build that are different projects?

white sun
#

That's what I'm doing with a 3rd content project. No issues so far, just build the remote addressables, then load the generated catalog in your client/server projects

ionic shadow
#

Is there any easy (automated) way to find dependencies between a local group and remote group? (or simply- 2 different groups?)

I found out that having a reference (direct reference, not assetreference) in a local group to something that's marked as addressable in a remote group causes the remote group's bundle to be downloaded when loading the local asset 😵.
I found some of the dependencies by hand (looking at Bundle Layout Preview unfixable rule in Addressables Analyze), but apparently there's more things left that I must have missed...
I expected it to put asset duplicates in the local and remote groups in such cases, but nope 😐

olive plover
#

Hello All

This is Pranoy. I am trying to add the audio files in my project to the Addressables group but I am unable to do so. This is because there is no option of selecting the addressable option in the audio import settings in Unity.

Can you please let us know, if we can use audio clips inside Addressables group or not? Or am I missing something?

ionic shadow
#

Did you actually install the addressables package? Audio clips can be marked addressable and the option should be there.

olive plover
placid quest
#

Hello All. Im using Addressables 1.16.19 in my project with Unity 2020.1.17 and running into a weird issue. I use unity cloud build to generate my assets from a azure git repo for my app (live on android and ios) and then push those generated assets to an azure blob storage to update the assets in the app. This has been working great for over a year. I normally make changes, commit to the repo, then in cloud build do an update against the content_state.bin file for each build target.

Recently my azure team enabled Git-LFS and specifically targeted FBX files because the repo was getting too large to generate builds via azure. This obviously caused issues when I generated assets because the FBX files were no longer directly in the repo. My assets would still appear when placed or used in the app BUT without a model/mesh. When this was discovered I immediately removed all LFS stuff and recommited all the FBX files. However, doing an update to the addressables via the method above did not fix the issue.

So I grabbed an older content state.bin from version control pre-GitLFS and updated addressables against that and it fixed the issue - for Android. But grabbing the same comits content state bin from the iOS folder and updating iOS assets against that state bin did nothing. Notably a git compare between the current content_state.bin and the older version say they are the same anyways. But now even when I update current assets the changes do not seem to be taking effect after building assets.

Does anyone know what could be going on? Or if not does anyone know if there is a way to generate a brand new clean set of addressables for the current build player (ie - not generating a whole new build of the app, just the addressables) via cloud build?

tired blade
#

hi, uh it might be a dumb question.. but having the prefab (containing a mesh and material with texture) in the addressables should pack everything together, right?

ionic shadow
final sorrel
#

With Addressables, can I store the Result from an AyncOperationHandle in a variable and pass the variable to the Release() method? Or do I have to pass the operation handle?

uneven onyx
#

A addressable prefab I have is referencing a scriptable object. When creating an instance of this prefab (via LoadAssetAsync then GameObject.Instantiate) the reference to the scriptable object becomes a different reference than one on a component in the scene from the start, so equality comparisons don't work. Any ideas how to prevent this?

mild flax
uneven onyx
#

yeah - I managed to google correctly and found some forum posts about this too. I was hoping there would be a way to check equality via something "deeper" like what the addressable SO was created from, but it doesn't seem like that exists

#

option (3) is make sure there are no scene references to the SO, everything comes from the bundle, I think?

mild flax
#

option 3's valid yea 👍
fwiw I created asset partially to help with this problem (it's called BTagged) but you could create something similar if needs be. Basically you inherit from it instead of SO and it gives you a .hash that's unique per asset.

void grove
uneven onyx
mild flax
grave hatch
#

Hi I got this bug when try to load model 3d remotely, anyone know how ti fixx this?\

low halo
# grave hatch

It means your Meshrenderer either has no material or the material is using an unsupported shader

#

the model itself loaded fine

grave hatch
#

thank @low halo ! I figured it out. It's only happen on editor(2020.3.21f1) but work fine on the builds
Seem it's a unity bug when loading assetbundle remotely on editor?

#

the assetbundle's data is right but unity editor can't load the shader

#

just click the Lit again then it will work on editor

random nymph
#

Sort of wacky, but if you have one main character that is a constant throughout multiple levels or scenes, is it better to have the one character on dontdestroyonload, to keep him throughout the scenes, or a prefab of the character with the same stats?

verbal harness
#

I have a question in video form: https://youtu.be/CDGdfuNFY98

Starfighter General: One MMO to rule them all and in the light free them: https://www.starfightergeneral.com/

Starfighter General: A soul gamer indie in the age of boring corporate spew.

This action MMORPG will have live game masters. Those who role play well whether good guy bounty hunter, bad guy pirate, emporer or whatever will attract th...

▶ Play video
coral pier
#

We're having an issue in our HDRP project where skinned meshes loaded via addressables don't participate in indirect lighting, any ideas?

narrow tiger
#

hi how can i pack CompatibilityAssetBundleManifest after sbp? like old build pipeline's output

cursive salmon
#

is it possible to get addressable final path? The one from which given addressable will be downloaded

uneven onyx
#

has anyone else had an issue with children of an instantiated addressable prefab lose the layer it was on?

languid widget
#

@wary mantle Don't cross-post, use relevant channels.

vague oar
#

I am getting this error when I try to load my assets from server. Any solution?

ionic shadow
#

Is there any way to profile how long it took the addressables system to download a bundle, and how long did it took to decompress and load a bundle?

cedar loom
#

Hey guys
I have a question about Asset Bundles, If I have two separate projects, one for creating DLC (A) and the other the main project (B). Can I create an Asset Bundle in Project A and then, create a bundle. Then after creating the bundle, load it in Project B? Right now this doesn't work for me using Addressables. Also Addressibles does not seem production ready

shell citrus
#

Hi, I am in need of suggestions.
I am creating a Mobile game and it contains a lot of objects (roughly 3000 static objects per level) but also a decent amount of levels (20 levels currently)
When the game was a bit smaller (10 levels), it ran more efficiently.
We believe we have optimized most things but it comes mostly down to the amount of objects we have in the game.
We currently store each level in a prefab but these prefabs are also referenced in the scene so we understand that they are all loaded into memory and may cause the increase in lag.
We are looking to only load each level when need but the difficulty comes from the fact that each level mostly shares the same objects.
We have recently tried using Addressables but to no success in performance and I understand that we implemented everything correctly.
We are looking into using "Scene Streaming" next and storing each Level in another Scene. Will this work by any chance?
Also, any suggestions for improving performance is greatly appreciated!

drowsy fable
#

anybody know why .waitforcompletation freeze on android?

cedar loom
white sun
#

Not sure where you get that, I'm using addressable for a 3 project setup. Client and a server projects that load addressables from a 3rd content project.

coral pier
cedar loom
#

yeah it works 100% of the time using asset bundles. I am not sure what the disadvantage of an asset bundle is

#

something about memory? but couldn't you just build something that holds the references and removes them as you go ? :S

unborn sparrow
#

Hi Everyone!

I'm using addressables to distribute remotely content updates. I have a question regarding how the client updates his content. In my design the client checks for updates when the app starts and forces the player to download before continuing. I have implemented this calling sequentially:

1 - Addressables.InitializeAsync
2 - Addressables.CheckForCatalogUpdates
3 - Addressables.UpdateCatalogs
4 - Addressables.GetDownloadSizeAsync for each of the keys of my catalog to get the total download size
5 - Addressables.DownloadDependenciesAsync to download those keys that returned a size > 0

this works properly, but there's a small issue I would like to fix:
steps 1, 2 and 3 download the catalog hash from the CDN. I'm fetching it 3 times instead of one and I would like to minimize traffic to the CDN.
Has anyone found this situation?

slate timber
#

somone please tell me how do i get purchased data from gamefoundation and use that to change skin of player 2d

ionic shadow
warm badger
#

Are addressables really better than the resources folder?? Apart from the remote setup everything else feels the same

wooden moss
#

They solve different problems. They can split up your final game so you might not need to publish everything to everyone.

late fractal
#

Hey guys, I just wanted to clarify. Is it every time I launch my application when there is internet, unity will update the addressable from cache?

I know when I don't have internet it will load everything fine. I just want to know because some of the cache file can be large and with a good number of users it can incur a charge from AWS.
So i just want to know when does unity update the addressable cache, because I was just wondering if it is just when a change is made to cache files?

I couldn't find a conclusive answer to this, so apologies if an answer to this already exists.

kind depot
#

I'm getting into Adressables and have a question about moddability.
As far as I understand it, I'd load the built catalog of the mod by filename.

I'd like the user to overwrite existing game data tho, i.e. modifying existing Player Stats. How would I approach that?

#

Loading a new catalog would load them alongside the existing ones, as opposed to replacing them.

#

And unloading a catalog isn't possible, is it?

#

Even if it was, AssetReferences would then lose their reference as it's tied to the GUID, which includes the Catalog, right?

mild flax
mild flax
kind depot
#

Wait, it's possible to replace them?

#

But yeah, it is required to do so while the game is running.

late fractal
kind depot
#

I actually do have the moddability implemented, but using Resources and JsonUtility.Overwrite. It works, but using Addressables would be nicer as the modders could use Unity itself and my custom editor scripts for a nicer modding experience.

mild flax
late fractal
mental lily
#

How should I go if I want to move all the implicit dependencies of a bundle into the explicit ones?
Is it something I can do via code?

#

(this is just a step towards what I need to achieve)

vague oar
#

Hello, I am using addressables in my project to reduce apk size. I have my assets in s3 and it loads perfectly in editor. However when I build for android it throws this error. RuntimeData is null. Please ensure you have built the correct Player Content.Any solution?

mental lily
#

Can someone confirm that an AddressableAssetEntry cannot be part of multiple groups? Can't find this anywhere in the documentation

kind depot
#

Do Tilemaps work with Addressables? I don't know how Tilemap serializes its Tiles, but I'm guessing its hard references to the Tile ScriptableObject? That would break the Addressables system.

neon vortex
#

Do I have to completely rebuild all my addressables from scratch every time I'm doing a full app build? If I make no changes to my addressable assets (e.g. just a code change), can I not cache what I got from the last build?

mental lily
#

Why is it so hard to get rid of Unity standard shader dependencies? anyone knows hot to do that? I overwrote all model importers to use a custom material, but there are still dependencies i can't track down

fickle drum
#

Please help, tried everything to fix it - Releasing render texture that is set as Camera.targetTexture! Context : Android, using custom render texture (asset) in the addressable prefab. When releasing gameobject via addressable release instance - it always throws this error. What should I do?

low halo
#

what error?

digital palm
#

hey so this happened to my unity and I dont know how to fix it UnityChanDown

wooden moss
#

load a backup. probably some version upgrade bug

inner spear
#

Not sure if this is the right space to ask this. I used to have a texture (2D Sprite) assigned to a game object and in the editor it shows the texture just fine. When you play, it proceeded to show the texture just fine. Idk what I did, but I edited, moved, and renamed some stuff. I reassigned the new texture onto the game object as an image (source image) just like I did before. Absolutely the same exact steps. Shows the preview perfectly fine in the editor mode. However, when I play, suddenly it's just plain white instead of the actual image. This seems like an obvious problem but can't get myself out of it. ANy tips?

#

I have confirmed that the image I'm attaching to the image component of my gameobject is indeed a Sprite (2D) with the correct parameters. It works perfectly fine up until I click play. Then I just get a white fill instead of my texture

#

And that same source image / texture works fine on any other game object except this specific one. Which I just found out. So furthermore points to the game object for some reason

#

Yikes. That one is on me. Was editing the object outside of the prefab and needed to modify the prefab. 😐

sage hinge
#

I don't know if I should ask this here but
I have a folder which contains scripts. When I load an AssetBundle, the desired GameObject (prefab) instantiated on scene load the scripts from the Local Script Folder (with their custom values). So, should be possible to Drag N'Drop the Prefab and save it with all the values. But after make it, the scripts references are missing. I must see the Prefab instantiated, tell the (same) Prefab from my project the specific scripts that are lost after import it, and assign the values manually
Why?

celest rivet
wraith edge
# celest rivet Can someone explain to me what the "key" is in this? https://docs.unity3d.com/Pa...

A key can be one of the following objects:

gloomy kelp
#

Does anyone know of an API to know whether addresssables is building atm?

When building addressables an Awake is called, and that destroys objects. This shouldnt happen during the build, so i'd like to test this.

Its not BuildPipeline.isBuildingPlayer, nor EditorApplication.isCompiling

mental lily
#

Anyone knows how including shaders in addressables work? what happens with .cginc files for example? they are not referenced as dependencies, should they be included too?

gloomy kelp
# mental lily Anyone knows how including shaders in addressables work? what happens with .cgin...

From the perspective of what is included, its a reference in the material like any other.

You can see this if you have serialization to text mode, and open the material in a text editor. It refers to some texture by GUID, and the shader by GUID. No different.

CGINC files dont exist in runtime. When the shader is compiled quite literally, the contents of the gcinc file is copy pasted in the shader file.

mental lily
gloomy kelp
#

How do you refer to them in code? Shader.Find?

mental lily
#

yes

#

(it's not my code, i would have referenced explicitly for better tracking)

#

(but I'm not confident modifying assetstore stuff as it's difficult to track and might be overridden with updats)

mental lily
gloomy kelp
#

Yes, with Shader.Find unity cannot find your dependency, and it wont exist in your build.

mental lily
gloomy kelp
#

No, there is no generic asset bundle. No all other stuff remaining bundle, that doesnt exist.

mental lily
#

then how is it that even if i'm not incluing the shader specifically, it still doesnt throw an error 🤔

gloomy kelp
nimble stratus
#

Testing to make sure I can load new addressables dynamically from an existing build, and I ran into this. Any ideas on what might be causing this?

late fractal
#

Hey guys, is it possible to only update one addressable group from a project?

late fractal
#

The reason I'm asking, my project uses a lot of groups to separate content. But i might want to update one or two of them, rather than having to build everything out every time.
That's why i'm asking if its possible. I couldn't find anything on google. So i though I would ask.

slate timber
late fractal
sour rivet
#

Is there an interface I can implelement to run a script automatically after addressables build ?

low halo
#

Then you can either just add your custom stuff at the end of the build script or create your own event that fires after the build for other code to latch onto

sour rivet
#

Thank you ! Seems like something than could help me, i'll have a look at this

calm walrus
#

I am trying to make a webgl build with addressables

#

standalone x86_64 build works fine

#

and webgl build works fine in play mode

#

but it does not work when i upload it to itch

#
<Link  to my addressable bundle>.hash:1 
        
       Failed to load resource: net::ERR_FAILED
index.html:1 
        
       Access to XMLHttpRequest at '<Link  to my addressable bundle>' from origin 'https://v6p9d9t4.ssl.hwcdn.net' has been blocked by CORS policy: No 'Access-Control-Allow-Origin' header is present on the requested resource.
<Link  to my addressable bundle>
        
       Failed to load resource: net::ERR_FAILED
0.1.1.framework.js.gz:2 
        
       RemoteProviderException : Unable to load asset bundle from : <Link  to my addressable bundle>
UnityWebRequest result : ConnectionError : Unknown Error
url : <Link  to my addressable bundle>


_JS_Log_Dump @ 0.1.1.framework.js.gz:2
0.1.1.framework.js.gz:2 
        
       OperationException : GroupOperation failed because one of its dependencies failed
RemoteProviderException : Unable to load asset bundle from : <Link  to my addressable bundle>
UnityWebRequest result : ConnectionError : Unknown Error
url : <Link  to my addressable bundle>


#
_JS_Log_Dump @ 0.1.1.framework.js.gz:2
80.1.1.framework.js.gz:2 
        
       System.Exception: Dependency Exception ---> UnityEngine.ResourceManagement.Exceptions.OperationException: GroupOperation failed because one of its dependencies failed ---> UnityEngine.ResourceManagement.Exceptions.RemoteProviderException: Unable to load asset bundle from : <Link  to my addressable bundle>
   --- End of inner exception stack trace ---
   --- End of inner exception stack trace ---

_JS_Log_Dump @ 0.1.1.framework.js.gz:2
80.1.1.framework.js.gz:2 
        
       OperationException : ChainOperation failed because dependent operation failed
System.Exception: Dependency Exception ---> UnityEngine.ResourceManagement.Exceptions.OperationException: GroupOperation failed because one of its dependencies failed ---> UnityEngine.ResourceManagement.Exceptions.RemoteProviderException: Unable to load asset bundle from : <Link  to my addressable bundle>
   --- End of inner exception stack trace ---
   --- End of inner exception stack trace ---```
#

this is what i got from my web browser debug console

swift birch
calm walrus
#

aws

calm walrus
#

and the build itself is on itch

#

also tried the build on Unity play

oak olive
#

I'm not familiar enough with AWS to know how to fix the problem, but the error message seems clear enough; AWS is configured to forbid cross-linking to those resources from other sites. You'd need to change its configuration to allow link origins from Itch's servers (might be tricky, as Itch can change where you're hosted without warning) or just allow all cross origin requests for those resources.

calm walrus
#

with AWS

oak olive
#

Well, yes, it would. Your PC build isn't a web site, it's a client; there's no cross-origin requests happening there, just a client asking for a resource from a server.

#

The problem is that the CORS policy is forbidding requests for the resource from a web site hosted on a different server (in this case Itch or Unity Play).

calm walrus
#

interesting

#

so which serivce should i use

#

cuz idk aws either lmao

swift birch
# calm walrus so which serivce should i use

Unity offers a hosting service, which I believe has a generous free tier. That is what I plan on using for our projects. That said, I have no personal experience yet with hosting services for asset bundles.

oak olive
#

My guess is that most of them would forbid cross-origin requests by default; it's just sensible security practice. So whichever one you use you'll probably need to dig around in the server configuration?

calm walrus
#

gotcha

#

ugh

#

alright

swift birch
#

When entering Play Mode with a scene in the Editor which is in an Addressables group, does Unity load dependencies from Addressables? Or would it load them through the standard system (I am unfamiliar with what you would call this) and cause duplication?

#

If Play Mode is entered, I have a script run which unloads all scenes and reloads them through Addressables.

I thought this was required to avoid duplication, but Unity Open Project 1 does not perform this reload. So I am unsure if there is a workaround I am not aware of.

calm walrus
#

give it a try

swift birch
# calm walrus i think it does load the dependencies

I am not sure how to check. When I later load a scene through Addressables, it loads the dependencies twice, and they have different GUIDs. The Event Viewer shows only a single use of the resource, not two. But I don’t know if that is just a quirk with loading it through the Editor first

calm walrus
oak olive
#

(Though it's possible I'm misunderstanding your question.)

swift birch
# oak olive It does whatever is selected in the "Play Mode Script" dropdown in the groups wi...

I have a scene loaded in the Editor. That scene is also in an Addressables group. When I hit “play” to enter Play Mode in the Editor, does it correctly pass the already loaded scene through Addressables so that shared dependencies are correctly marked as loaded and are not loaded twice when I later load another scene through Addressables?

I am currently trying to figure out how to test this to know for sure

#

It looks like duplication is only happening with the Use Existing Build script, but that has me concerned that there are still issues that are just being masked by the other two Play Mode Scripts.

low halo
#

I'm getting this error (5 times) when trying to load a bunch of addressables, and my async operations never complete. Is there a way to get some useful info from this?
https://hatebin.com/vqdjeqruas

river pelican
#

Hello Everyone, just a simple question : How can I apply "Simplify Addressable Names" via script ??

neon vortex
#

When building manually and calling AddressableAssetSettings.CleanPlayerContent(); when we're done, there's still a AddressableAssetsDAta/<platform>/addressables_content_state.bin file left over. Is this intentional? We want that to be removed when doing cleanup, I'm curious if there's a more proper/idiomatic way other than using System.IO to delete the folder using ContentUpdateScript.GetContentStateDataPath() to get the path.

formal depot
#

What's the difference between addressables and serialzedfield?

#

You both set in the inspector and both use to instantiate

low halo
# formal depot What's the difference between addressables and serialzedfield?

the main difference is that when you reference something directly with a serialized field it gets loaded into memory immediately when the thing that references it is loaded.

For addressables it's merely a lightweeight asset address that gets loaded immediately, and the full thing isn't loaded until you ask for it.

formal depot
#

I made the remote files a set them on the online drive but does the build pulls the files and updates or when i launch the game?

slate timber
#

Hello everyone, I have a question, not sure if someone with more experience could have an answer.

I've been working on a project where I'm synchronising the appearance of networked players by sending the AssetGUID of an Addressable through a System.Guid object and then recreating the AssetReference on the client, but since I updated my project to Unity 2021.2 and the latest Addressables version this stopped working, doing some tests it seems the Guid format is not normalized when creating an AssetReference while the main Addressable system requires the Guid (RuntimeKey) to not use dashes (The default behaviour of System.Guid.ToString()) otherwise it will throw an InvalidKeyException, this was working before, not sure what might have changed, but the question is:

Should I be using a different container (In general, not network specific) for the GUID of the AssetReference or is there some best practices I could refer to based on my use case?
Thank you

low halo
# slate timber Hello everyone, I have a question, not sure if someone with more experience coul...

If possible, since this is going over the network, instead of sending the string version of the GUID, why not send the raw bytes (16 bytes) and construct the GUID from bytes as well.
https://docs.microsoft.com/en-us/dotnet/api/system.guid.tobytearray?view=net-6.0#System_Guid_ToByteArray
https://docs.microsoft.com/en-us/dotnet/api/system.guid.-ctor?view=net-6.0#System_Guid__ctor_System_Byte___

That should be consistent and also more performant/less bandwidth to boot

low halo
oak olive
# low halo Bumping this question again since it's been a couple days... Still not sure how ...

This possibly isn't the most helpful answer, but I would just debug it? We have source for the addressables library, and it's a straightforward null reference exception, so I would start by looking up exactly what it's dereferencing and following back where the null came from. Unfortunately I don't have that version of the addressables package handy so I can't check the file and line myself.

swift dock
#

Hi, this is about asset bundles but I think this will be the appropriate channel..
Have any of you got this error while downloading and loading the asset bundle from the web :
failed to decompress data for the assetbundle 'memory'

#

Any ideas on how to deal with it?

short hornet
#

Hallo. I'm trying to build separate version of our game and demo. my first thought was to have separate groups for main_scenes and demo_scenes which would have overlapping content but the demo_scenes would only include the scenes used in the demo. I'd then uncheck "Include in Build" for which ever one wasn't going to get used before building.
The big problem I'm hitting is that if i add a scene to demo_scenes it is then removed from main_scenes.
Any ideas how i can stop this?

tepid ore
#

So a colleague added Addressable Assets to our project, and upon checking out the project with the new addressables dependency, Unity touched the AddressableAssetSettings.asset file adding my local computer IP (to my colleague's already listed local IP). This doesn't seem sensible to me. Is there a way to prevent Unity from adding the IPs to the code base? I haven't seen any serialized editor property for those settings, so I also wonder what those are?

#

The changed and added private IP addresses, are those of two different local adapters I have on my development machine. These are also listed when starting a local asset hosting server. I assume this allows game clients to use my local Editor for downloading the assets. However, having those IPs in version control seems bad, as it will keep touching those files in a team environment.

low halo
# oak olive This possibly isn't the most helpful answer, but I would just debug it? We have ...

Eventually through bisection I was able to find the references that were causing me trouble and the fields within them that seemed to cause the issue. Luckily those fields were not (currently) in use so I was able to remove them. Still have no idea what the issue was. The fields in question were AssetReferenceTextures on some ScriptableObjects that were themselves being loaded by Addressables

swift birch
# tepid ore The changed and added private IP addresses, are those of two different local ada...

I don’t have a solution unfortunately, but I did discover that this is only an issue with Addressables 1.19 and not 1.18. I am hoping it is a bug which will be fixed soon, because I could not find a way to disable it and it is causing noise in our repositories as well.

It also seems to store the private IP regardless of whether you are using the hosting service or not. So removing local hosting services likely won’t fix the problem.

swift birch
somber whale
#

I get these errors/warning every time I exit playmode. I'm not currently doing anything with addressables, so I know it isn't on my end. I tried deleting the Library folder, but no luck there. Any ideas? (Fixed, it was caused by the localization package not being setup)

short hornet
tepid ore
tepid ore
tepid ore
wooden moss
tepid ore
# wooden moss Or just put the affected asset into gitignore

Since the file also contains shared configuration, adding it to .gitignore would lead to devs not noticing when"real changes" are made that they need to add to VCS. Ultimately, all is a compromise, but smudge filters seem to cause the least amount of issues in team environments.

swift birch
final sorrel
#

I'm trying to use LoadAssetsAsync with a string[], however the method call is preferring the deprecated IList overload instead of the IEnumerable overload. How can I fix this?

magic falcon
#

How can i update to api 31?

oak olive
final sorrel
oak olive
#

Perhaps it should, but your question was how to fix it, right?

final sorrel
oak olive
#

If you're instead asking why it happens, I believe C# picks the more specific overload without considering deprecation, and since IList[] is more specific than IEnumerable it's the preferred choice. As such deprecating the IList version was probably an incorrect decision; they should have just removed it and let calls silently fall back to the IEnumerable version. (Assuming the two methods do the same thing; if they don't that's its own horrible can of worms.)

final sorrel
mental lily
#

Heyo! I'm trying to build a Preprocessor to automatically exclude all the AddressableGroups from our game's demo build (as it only needs a limited amount of game content)... but I'm getting this error:

UnauthorizedAccessException: Access to the path is denied.
System.IO.Directory.Move (System.String sourceDirName, System.String destDirName) (at <695d1cc93cca45069c528c15c9fdd749>:0)
AddressablesPlayerBuildProcessor.CopyTemporaryPlayerBuildData () (at Library/PackageCache/com.unity.addressables@1.18.19/Editor/Build/AddressablesPlayerBuildProcessor.cs:62)
AddressablesPlayerBuildProcessor.OnPreprocessBuild (UnityEditor.Build.Reporting.BuildReport report) (at Library/PackageCache/com.unity.addressables@1.18.19/Editor/Build/AddressablesPlayerBuildProcessor.cs:46)

#
    public int callbackOrder { get { return 0; } }

    string[] _excludedGroupNames = new[] { /* various keyboards, not important */ };

    List<AddressableAssetGroup> _excludedGroups = new List<AddressableAssetGroup>();

    public void OnPreprocessBuild(BuildReport report) {
        Debug.Log("MyCustomBuildProcessor.OnPreprocessBuild for target " + report.summary.platform + " at path " + report.summary.outputPath);
        var addressableSettings = AddressableAssetSettingsDefaultObject.Settings;
        foreach (AddressableAssetGroup aag in addressableSettings.groups) {
            if (aag != null) {
                Debug.Log("Processing " + aag.Name);
                BundledAssetGroupSchema bundledAssetGroupSchema = aag.GetSchema<BundledAssetGroupSchema>();
                if (bundledAssetGroupSchema != null && _excludedGroupNames.Any(c => bundledAssetGroupSchema.name.Contains(c))) {
                    bundledAssetGroupSchema.IncludeInBuild = false;
                    _excludedGroups.Add(aag);
                    addressableSettings.SetDirty(AddressableAssetSettings.ModificationEvent.GroupSchemaModified, aag, true, true);
                    Debug.Log("Excluded " + aag.Name);
                }
            }
        }
    }

    public void OnPostprocessBuild(BuildReport report) {
        var addressableSettings = AddressableAssetSettingsDefaultObject.Settings;
        foreach (AddressableAssetGroup aag in _excludedGroups) {
            if (aag != null) {
                BundledAssetGroupSchema bundledAssetGroupSchema = aag.GetSchema<BundledAssetGroupSchema>();
                bundledAssetGroupSchema.IncludeInBuild = true;
                addressableSettings.SetDirty(AddressableAssetSettings.ModificationEvent.GroupSchemaModified, aag, true, true);
                Debug.Log("Restored " + aag.Name);
            }
        }
        _excludedGroups.Clear();
    }
}```
#

the asset groups are actually modified correctly, but when the build actually start (so right after IPreprocessBuild has executed) I get the error I pasted above 😦

marble bay
#

Soooo...Addressables doesn't support just any file types huh, what a FRIGGIN let down!

prisma fable
#

what files types does it not support?

mental lily
#

Is it something I have to do during the build process, or do I have to strip them from the game build AFTER?

marble bay
marble bay
#

Can someone help me understand addressable more? So I am trying to use with WebGL, I have created a prefab that has a collection of different sprites under one parent. I tested the loading from Unity CDN in the Editor and I got the prefab to instantiate, my problem now is the objects come in pink, with none of the sprites showing, what step did I miss?

low halo
#

check your renderer(s)

zenith thunder
#

Can the issue be replicated in a build?

marble bay
zenith thunder
#

I have a similar problem with asset bundles. In editor everything loads fine but certain TMP and spine materials render as pink in editor. Work just fine in a build no pink

low halo
#

it should bring dependencies, but I don't know the details of your situation

zenith thunder
marble bay
marble bay
marble bay
#

Figured out what the issue was, I built the project and was able to load the addressables. What was happening is that I have a post build code that removes the StreamingAssets folder for other parts of my project that use it inside the editor (I eventually delete this folder after build since I will be downloading my assets so I just wanted to automate the process and remove the folder with a post build script). Apparently Addressables saves a folder in the Streaming Assets folder which eventually gets deleted thus not allowing the assets to load...

warm imp
#

Hi! 🙂 Does Application.backgroundLoadingPriority = ThreadPriority.Low affects Addressables.LoadSceneAsync?

river pelican
#

Hello, I'm trying to create a tool for my game ( the game is separated into two projects : the Main game project and the other project has the content of the game ) so in my content my project I want to able to Build Player Content for any platform I want without changing the Build target In the Build Settings.

What I tried to do is that I made a different profile for each platform and when I change the build target in my tool it changes the profile related to it, but it didn't work and I got this error :
"The file can not be loaded because it was created for another build target that is not compatible with this platform"
What are the possible ways to do this ?? Please if you have an idea tell me and Thank you in advance.

marble bay
#

I don't know, I think you have to build directly from that platform...

river pelican
#

Hey @marble bay thank you for the answer, that's my last choice I'll wait maybe someone have an idea

fast bay
#

Hi, I don't know much about addressables and I am not able to find out answer for my question. I need to make loading at runtime for ex .fbx model from specified user's path and I am wondering if it is possible to do via addressables or I something misunderstood?

fast bay
#

yes - I misunderstood or yes - is itpossible? 🙂

oak olive
fast bay
glad knot
#

Can I ask about Localization here? since this is the channel I can find somehow related to Localization.

mental lily
#

Does anyone know why the addressables build folder seem to be destroyed during the build process?

#

Trying to move away some unneeded bundles OnPreprocess, to move them back OnPostprocess, but while the first operation works, the second one doesnt :S

muted ocean
#

hey guys, my project has custom mapping that uses asset bundles to load maps that players can create using unity. I have a system setup that strips all the textures from the bundle build that are already included in the built game files (default assets) to reduce file size

#

up until now, i was using the resources folder to load these assets

#

im fed up with this system cause each time i update the game, a huge update is sent to steam (several gb even with nothing moved in the resources folder)

#

im trying to figure out the best way to handle what i want to do, and im thinking of using either asset bundles for the textures, or the addressables system

#

my question is this: if i were to bundle say 150 textures into an asset bundle, and i needed to load only about 15 for a specific map, does unity have to first load all 150 textures in the asset bundle before i can apply the textures i need to their materials?

#

and, if you know of any better way to accomplish what im trying to do, please let me know!

swift birch
# muted ocean my question is this: if i were to bundle say 150 textures into an asset bundle, ...

The “Memory Management” section of the Addressables manual says that an asset bundle’s contents can be partially loaded, but not partially unloaded. So you should be able to load those 15 textures, and as long as the other 135 textures in the bundle aren’t referenced anywhere they should remain unloaded. However, once you load those 15 textures, they will remain loaded until there are no more references to the asset bundle they were contained within. This means that when you load another group of textures for another map, the textures you had previously loaded will not be unloaded.

You will probably have to experiment with this using the Event Viewer to find an arrangement that works for your situation. You may need multiple bundles to ensure that textures are unloaded when no longer needed.

Edit: That said, what you want to do with custom maps where players can create them within Unity and then get loaded by the game is a fairly advanced use case and is outside of my experience with Addressables. Because of this, you might have additional issues with loading the textures that I am not aware of, and I can’t comment outside of asset bundle partial loading.

iron umbra
#

Can Unity Addressables be used to add more content to unity post launch? Like say I have 10 sprites in a folder and later add 10 more post release, i would like to load the new 10 sprites into the game without having to update the application. Sorry for the cross post

low halo
#

yes

muted ocean
marble bay
#

Hey guys, I am testing Addressables and am getting this error:

#

Thats an old file that was deleted, a new catalog was created today, why is it looking for old one?

#

It apparently still loads the object with the new catalog but I still want to know why its calling for an old catalog...

#

Now testing in Chrome Browser works with downloading on Macbook (instant download too), but when I try it on mobile it takes like 20 times longer to download on the same internet speed...this is NOT good obviously since the file isnt even that big, what gives? Anyone have ideas?

marble bay
#

After some more tests, it’s the Addressables.InitializeAsync that’s having the problem. The downloading is quick, but initialization takes long, any ideas to reduce time?

iron umbra
#

System.Exception: Unable to load dependent bundle from location

#

I am using Unity CCD to host the bundle

#

but for reason it always fails to load the bundle

#

I have checked the "Build Remote Catalog"

#

And the path seems to be fed by the editor itself since I've linked the project

#

I am running the editor in the "Use Existing build" mode

#

This is what I am doing in the script to load the textures from the remote path

#

I've set the label name to individual sprites in a folder and uploaded the bundle using "Build and Release"

iron umbra
#

nevermind got it to work 😄

lunar shard
#

Hello all, has anyone else experienced the components on a GameObject loaded through InstantiateAsync calling their Start method immediately?

#

for example

#
GameObject go = await operationHandle.Task;
//Above GameObject's components fire their Start methods here, and then the next line of code fires
return go;
#

When I instantiate a Prefab, for example, this is not how it works.

oak olive
# lunar shard for example

Yes; in my experience that is how all instantiate methods work if the component is active and enabled, nothing unique to InstantiateAsync. Sorry, this was wrong; I always get OnEnable and Start confused for this.

lunar shard
#

Done with work for today, but I will have to make an example project to test my own sanity about this

#

I am 95% positive that Start methods on components don't immediately fire as soon as I call Instantiate(prefab)

low halo
mental hare
#

do people have experience working with asset bundles and unity cloud build?

#

I'm not sure this is the right channel

#

if there is a channel more closely related to that pls lmk

#

I'm having trouble making unity cloud build generate the asset bundles for each platform

shrewd geyser
marble bay
# marble bay

I figured out this issue, this file is created during the build of the game so it needs to be available at all times. I deleted it when I uploaded a new addressable catalog. I wish there was a doc stating the required files needed at all times...

lunar shard
mild flax
#

In my exp verified has as many bugs as non-verified versions. I assume the only difference is that it's an editor+package combination passed some automated tests or something. Like most packages, every version has a different set of bugs - generally the more recent bugs are less bad than the older ones, though not always. We approach this by just trying (if we have issues) then rolling back if the issues are worse.

shrewd geyser
lunar shard
#

I agree with you.

swift dock
#

Does anybody have some experience with asset bundles?

#

I am facing this strange issue where when loading the game via asset bundles on a mobile, makes the polygon and the edge colliders stop working
It is fine in Editor, though

#

Really puzzled about this, anybody have any ideas regarding this?

swift birch
iron umbra
#

sorry wrong channel

celest rivet
#

Why doesn't this show up when trying to use it on a Unity button?

#

but string and int argument does

chrome swallow
celest rivet
#

Any ideas of a good workaround? Is there a way to load an addressable with a string?

#

nvm, found it

swift dock
#

But did manage to solve it by turning off "Strip Engine code" in Player settings. That fixed it.

slate timber
lucid mulch
#

guys i got this error and i have no idea to fix this.

#

i'm trying to get all prefabs by Addressables.LoadAssetsAsync

swift birch
lucid mulch
#

@swift birch here

lucid mulch
#

for some reason i couldn't send that code in this channel 😩

lucid mulch
low halo
#

basically I had some empty asset references in some of the assets I was loading and that was breaking things

#

I don't know why that was breaking things but I removed that field since I wasn't using it anyway and it worked

swift birch
#

While debugging this issue, I discovered a different unexpected behavior: If you load an asset through that code, and the asset has sub-assets, such as a TMP_FontAsset, it will attempt to load the root asset and all the sub assets. This causes an exception due to a type mismatch between the root asset and the sub assets. This is solved by supplying the type to LoadResourceLocationsAsync().

This is documented in the Addressables manual under Using Addressables at runtime -> Loading Addressable assets -> Loading locations of sub-objects. This was unexpected for me personally, so I thought it might be worth bringing up, in case it’s helpful to someone else.

undone elm
#

is there a good guide or tutorial to getting asset bundles set up

#

i followed the unity offical page on asset bundles, but its not working, at least not in edit mode.

lucid mulch
swift birch
# lucid mulch i just skipped those error and they worked like nothing happen. that weird 😅

It is pretty strange. I spent 6 hours yesterday attempting to intentionally break Addressables in this way, and I could not figure out how.

The error is caused by a null value being returned from AssetDatabase.LoadAssetAtPath() and Addressables attempts to use this null value without first checking if it is valid. But because of previous checks and code, I don’t know how it’s actually getting to that point at all; in my tests, it always errors out before this point.

undone elm
#

please, can anyone help with accessing asset bundles?

#

do I use or not use Application.streamingAssetsPath in edit mode?

#

Ive followed now two different examples unity has provided for accessing asset bundles and neither work

undone elm
#

oh

#

the two different examples build the assest to different directories

#

but they both ask for the streaming assets folder when trying to load

slate timber
#

how to build an adressable group without building the player?

#

so i can update parts of my game independently of each other?

slate timber
#

?

low halo
#

Is there a reason AssetReference is not an IResourceLocation?

#

How do I call Addressables.LoadAssetsAsync with a list of AssetReferences?

low halo
#

However When I select a folder in the project window, it doesn't have any inspector. How do I actually mark a folder as addressable?

swift birch
swift birch
# low halo thanks

Oh! One issue though that I should mention: If you are using the Asset Database Play Mode script and you have an asset that is both marked as addressable and within a folder that is also addressable, there is a bug where the asset will be returned twice. I believe the bug affects LoadResourceLocationsAsyc() but I cannot remember if LoadAssetsAsync() is affected. I encountered this bug in 1.18.19

low halo
#

What's the major difference betwen LoadResourceLocation and LoadAsset btw

swift birch
#

@low halo You can get resource locations without being locked to a specific type if you use LoadResourceLocationsAsync(). This was actually the cause of a bug in my case, because I did not expect it. It might be useful if used intentionally though. The manual also mentions using it if you need to create an association between the key and the asset that was loaded with that key, as LoadAssetsAsync() does not guarantee that the assets are loaded in the same order as the supplied keys. This is mentioned at Using Addressables at Runtime -> Loading Addressable assets -> Loading Multiple assets -> Correlating loaded assets to their keys

Besides that, I haven’t seen a difference between the two. I’ve been preferring to use LoadAssetsAsync() where possible to increase code readability.

low halo
#

Has anyone ever seen an issue where LoadAssetAsync never finishes? It doesn't get an error or anything, it just dies completely. The completed event is simply never called. Nevermind I'm being stupid.

swift trout
#

I was trying to update some images in one of my addressables groups and it wasn't showing up in the window

#

so I unchecked the folder for "exteriorDoor" and checked addressables again for it, and suddenly the images showed up in the window

#

so I rebuilt the cache and now I'm getting InvalidKeyException

#

to make sure I didn't screw something up with the images, I unchecked/rechecked the "typeDoor" folder and also rebuilt the cache

#

and it too is now throwing InvalidKeyException

#

I'm not sure what I'm doing wrong but now I can't get the database to work the way it was before

#
                yield return new WaitUntil(() => scrollpaneLoaded);```
#

I've tried purging the cache and rebuilding a couple of times, and each time it tells me the key is invalid, even though I can see it in the JSON, the folder, and in the Addressables Groups tab and there's no typo

swift trout
#

aha I figured out the issue, I was using labels for those groups and resetting them erased the label

#

I didn't notice because the groups tab was small and the labels were hidden

#

🤦‍♂️

undone elm
#

I just had my addressable groups disappear

#

Is there a way to bring them back?

#

oh nevermind

#

was being dumb

#

missed I had a search

undone elm
#

is there a way to automatically add a preflix to addressable assets in a group?

undone elm
#

its just that there is a lot of objects to rename with a preflix.

wicked frigate
#

New to addressables, doing a tutorial, I am trying to get a reference to an instantiated object, but the value remains null

#

How do I get a reference to an addressable instantiated gameObject?

#

I had to add ".Result" even though it wasnt in the tutorial, because otherwise I cannot get a reference to the gameobject at all, but that didnt work so it must be wrong

wicked frigate
#

Hmm, could it be because the tutorial is asking me to instantiate something without async loading it first? so when I try to save the object to a GameObject, there is nothing to save yet because it takes 1+ frames to load?

wicked frigate
#

but the game object does get instantiated into the scene so I know that part is working

wooden moss
#

i don't understand

wicked frigate
#

Thing is null

#

but the object gets instantiated, I just don't get a reference to it

wicked frigate
wooden moss
#

are you using a coroutine?

wicked frigate
wooden moss
#

you of course have to wait for the operation to succeed. i don't know what tutorial you're using

#

maybe they don't use the async variant

swift birch
# wicked frigate how do I make it not be null?

The AsyncOperationHandle returned by InstantiateAsync() will not have a valid value in .Result until the AsyncOperationHandle completes, and it needs to complete successfully.

To be notified that an AsyncOperationHandle has completed, you can subscribe to its .Completed event. You can also yield return the handle inside a coroutine, which will yield until the operation completes. You can also poll .IsDone periodically in a location like Update(), but I recommend using a coroutine or an event listener instead as the code will be easier to work with. If you are comfortable with async/await, you can also await the handle’s .Task.

For further information, I recommend reading the Using Addressables at Runtime -> Operations section of the Addressables manual. It includes code examples.

prisma fable
#

is there a way to limit the scope of the assetreference when selecting in the inspector? say limit the scope of it on a specific group?

wooden moss
#

not that i'm aware

fervent lintel
#

Hi, does anyone know of a good guide to making a webgl release that uses addressables to minimise loading times? I want to have everything for each scene download when that scene is loaded. I found some tutorials and understand the basics of addressables and Unity's Cloud Content Delivery, but I cannot find out how to get started on putting entire scenes in addressables without making a mess. Any help would be greatly appreciated :—)

prisma fable
#

when loading a scene it seems there's a slight hitch despite the function having an async suffix, is this normal?

prisma fable
wooden moss
prisma fable
fervent lintel
oak olive
oak olive
fervent lintel
oak olive
fervent lintel
#

So, if I understand correctly, I cannot unload an already loaded scene like that and I'll have to make a scene that has a script that controls the loading of all scenes?

fervent lintel
oak olive
#

I won't say it's impossible, but I don't know any ways to do so.

surreal hill
#

is there anyone who is bored and wouldnt mind helping out a young fellow unity user?

wooden moss
#

with what

swift birch
prisma fable
fervent lintel
fervent lintel
#

If I make all my scenes addressables, and upload them to the unity cdn, will that automatically put all the dependencies (gameobjects, materials, etc) in there too? Or do I have to put those into groups seperately?

warm wagon
#

Having issue getting {classname.staticString} to work as the local load folder when using external assetbundles

#

any ideas?

#
public class ModLoader : MonoBehaviour {

 public static string LOAD_PATH= "Mods";
}
#

Unable to open archive file: ModLoader.LOAD_PATH/npc_test_assets_all.bundle

#

Any idea why it's not evaluating it?

oak olive
# warm wagon

You might need a little more context, as I've no idea what object this is even inspecting; there's no mention of an "Internal.LoadPath" property (that I can find) anywhere in the Addressables documentation.

warm wagon
#

Is there a way to avoid multiple built in shader bundles?

I have a client project trying to load 2 different catalogues and a model from each (each rely on builtin shaders).

The first loads fine but the second errors due to trying to read it's own copy of builtin shaders and there being a duplicate

oak olive
warm wagon
#

Any idea what the right settting is?

swift birch
fervent lintel
#

Thank you @swift birch

low halo
#

wdymn by "doesn't work"? Is there a compile error? Runtime error?

surreal hill
#

hiii, if i have 2 scripts, one has a timer and a bool timergoing = true, and the other one has some other stuff, how can i make timergoing = false from the script with the other stuff:)<3

next rune
#

Is there a way to load unbundled content within Addressables if it's in the right format for unity to consume already?

Alternatively, is there a way to programmatically create bundles either without the editor, or while using the editor purely as a headless library?

oak olive
#

Creating bundles using the editor as a headless standalone application should be doable; I'm not aware of any way to do it as a library, though.

next rune
#

Hmm- Can you extrapolate what you mean? I didn't know the editor could be launched headless

oak olive
next rune
#

that'd be sufficient, I think; thank you 🙂

it looks like I want -batchmode -nographics

stoic hill
#

does anyone know how to chanje the directory of an adressable file. the dream would be drag n' drop however i cant quite get it to work.

#

id assume the above would work however it does not

#

Nmod is the adressable file

#

here is what it looks like with its preset folder:

stoic hill
#

ah, ive seen it doeset work in diffrent folders at all

#

how would i fix somthin like this

stoic hill
#

so ive decided to take this a new rout and use Application.dataPath however i still get these errors when loading. any help?

stoic hill
#

---Nevermind---
so I was missing a subfolder in my load path. I still dislike that I cant just move an addressable to wherever I want tho.

swift birch
fervent lintel
#

Do I put scenes that I want to be downloaded separately into separate groups, or do groups not work in that way?

shrewd geyser
#

@fervent lintel you can put them in the same group and set the group's Bundle mode setting to Pack Separately

fervent lintel
shrewd geyser
#

Yes. All dependencies that are not included as another addressable asset will get included in the scene’s bundle file as well.

fervent lintel
shrewd geyser
#

You can use the Analyze tools to check which assets would be added in as duplicates. This is the one 'fixable' rule. You can run that, and it will tell you (and can fix for you) which assets will be duplicated across bundles

#

It will put all duplicate assets into one single Addressables group. You can move them around to other groups afterwards if that makes more sense for your project structure

fervent lintel
#

Alright, major thanks, I'll look into the Analyze tool

fervent lintel
#

Will UnloadSceneAsync remove the scene from the cache, or not? I've found different sources claiming the opposite

covert verge
next rune
#

Is there any way to make a "dynamic" catalog where resources can be summoned by request in a particular address space?

#

Something like "all addresses within foo/bar/ may exist, if the cache hasn't already resolved it, ask this provider to check for its existence on-demand"

shrewd geyser
shrewd geyser
# covert verge Oh heck I didn't see this channel. Sorry, I posted this in advanced code by acci...

Hmm, no, Addressables doesn't really lend itself to that. It would in a resource managing/loading aspect of it, but not in the generation-aspect of user generated content. Especially not from within the game.
In theory I would think this is possible if your players downloaded the Unity editor and had access to (part of) the code and assets that they require to build their content, but something like this isn't possible from within the running game itself as a lot of tools for building are not available in the player.

shrewd geyser
next rune
#

I was under the impression that custom providers still required catalogs that resolved to a fixed set of contents

#

e.g. you can't ask for a resource and detect which catalog to try to load based on the address requested

shrewd geyser
#

Hmm, that's true. 'A' catalog is indeed required to be loaded. But I think it's up to the provider how it handles the catalog in terms of how to search for the requested address. Perhaps the catalog can be somewhat different than the default generated ones and provides your custom provider with hints as to what to load. But perhaps that's taking it too far already (and I'm just speculating of what I would investigate, but I can't say for sure something like that will work)

next rune
#

Ohhh, so you're suggesting there may be room to overload the catalog interface itself and use that to determine "if it contains an address"?

shrewd geyser
#

Yeah, something like that

next rune
#

I'm not sure I can tell which interface is appropriate for that; I'll have to dig deeper- but if anyone has any information on what might be the right interface to override, I'd be glad

oak olive
surreal hill
#

how can i change a float value for a x amount of seconds then it changes back

next rune
#

that's not really an addressables question- but you can use an async function and await Task.delay(x * 1000) between setting the variable and resetting it

low halo
pale marten
#

i'm noob addressable user
i need help if this problem below is a bug or if there is anything i missed

Question 1
AssetReference is null when "Use Existing Build"

  • Scene, Prefab, Object are all added to Addressable group
  • Clean, New Default builded
  • It's working normally in fastest mode
  • The problem is not reproduced in the sample example using Addressable 1.18.16 (same setting...)
#

this problem does not occur when playmode in that scene,
when loading the scene through LoadSceneAsync, all of the things binding to the
scene's AssetReference change to null

twin sparrow
#

"Fastest" mode would not use the bundles, it would just serve it from the assetdatabase

#

are you sure the bundle is being built?

pale marten
twin sparrow
#

search your project/Library/ folder for *.bundle

pale marten
#

in Library\com.unity.addressables\aa\Windows\StandaloneWindows64

#

Right below the Library folder, There is no *.bundle file.

twin sparrow
#

yea, thats the right location for it though. is that the bundle you were expecting?

#

(did you define any other Packed groups?)

pale marten
#

To simplify the problem, i currently have only Default Local Group, removing all groups.
Shall i make a new group?

twin sparrow
#

I saw a ping. did you send something?

pale marten
#

Perhaps the setting of the Discord channel erased the mention message immediately.

twin sparrow
#

lol yes

#

(if its a big ol' script paste yea it'll nuke it)

#

editor only serialization will indeed go null if drawn from built stuff

pale marten
#

Is this normal to happen when #if UNITY_EDITOR is used?

twin sparrow
#

that compiler directive will hide that code anywhere except when using UNITY_EDITOR

#

so serialized variables wont serialize in a Build

#

that can have weird implications in an AssetBundle

pale marten
#

Thank you for your kind answer. It was helpful. 🙂

twin sparrow
#

👍

pale marten
#

I have a problem when loading scene with LoadSceneAsync (additive, activeOnLoad true)
when i load scene with LoadSceneAsync
and Scene was set to be active with SetActiveScene,
lighting of SceneView looks abnormal, but GameView looks normal.

There is no such problem if i load the Scene by SceneManager.LoadScene (not addressable) way
The hierarchy item is also different when using SceneManager.LoadScene and Addressable LoadSceneAsync

which part should i check?


I solved the problem.
The problem was the always refresh option for the scene editor .

austere rune
#

So, I'm experimenting with Addressables.LoadSceneAsync / UnloadSceneAsync.. and it seems like it's failing to clean up memory properly (textures and meshes), causing a memory leak. I found a couple of old threads about it, but seems this has not been fixed yet?

#

Fresh project, using the urp sample scene to experiment with.. Getting these results:

fluid smelt
#

The prefabs i have marked as addressable show pink on every texture when in playmode on android in editor. if i run a build the textures are fine. this has become a problem because its made debuging very hard

#

help? ❤️

south whale
wicked frigate
#

I have rooms that are addressables.
rooms have doors, but the doors are children of the room, and cannot be addressable themselves.
How do I reference a specific door within a room after loading the room addressable itself?

#

Ive tried googling it but I cant find any example of targeting a child of an addressable

wicked frigate
#

Is there a way to reference the child of an addressable?

#

drew a diagram to make it easier to understand

swift birch
wicked frigate
#

Going to the Room is the easy parts, Doors have AssetReferences to the addressable Room, but afterwards I am not sure what kind of data type will allow me to target the doors within the room

swift birch
# wicked frigate Going to the Room is the easy parts, Doors have AssetReferences to the addressab...

You could create a serialized class that represents the door, and contains its Transform reference and an int field that stores its ID. Then store a list of these serialized classes instead of the Transforms.

Alternatively, you could create a MonoBehaviour that stores an int field for the ID, and add that to each door. Then store a list of these components instead of Transform or use GetComponent.

swift birch
swift birch
wicked frigate
swift birch
# wicked frigate Reading this all now 👍 Doors are "Transitions" so I have a serialized class. I...

A thought I just had: You could create an empty ScriptableObject and create assets of it for each door in your game, and then use reference to that asset instead of an int ID. That way you don’t have to remember which numbers go to which doors while designing rooms. Room C’s Door 2 and Room A’s Door 1 would both use the same ScriptableObject asset as their ID. Normal advice for working with ScriptableObjects and Addressables applies regarding dependencies and accidental duplication.

wicked frigate
#

Doors wont explicitly return the way they came is my thought, Door D might not even go to A B or C in that example

swift birch
mild flax
#

Small note on ScriptableObjects + addressables - the ones in a build will not be deserialized as the same Unity Object as ones from addressables. So, if you have a class in your main app that references SOs (e.g. a 'door mapping' monobehaviour) - they won't reference the same objects as the ones that are deserialized in your door prefabs.

wicked frigate
wicked frigate
#

Good to know, that would definitely have tripped me up 👀

mild flax
#

yea.. not intuitive at all

wicked frigate
#

I have a custom inspector that I need to load an addressable to get some information from it in the project, is that a bad practice?

#

Loading addressables in Editor while the game is not even running I mean?

#

X/Y question maybe, hold on

#

How do I get the prefab an addressable refers to for use in a CustomEditor Inspector?

#

its an AssetReference currently

wicked frigate
# wicked frigate

In this example Asset is null because I wasn't loading the Addressable before trying to access it

#

my addressable is always null it seems, Im guessing you just cant load addressables from editor scripts when the game isnt running?

#

"Addressbles just isn't set up for editor loading (outside of play mode)"

#

Well this is a bit of a problem for me

#

I need info about the prefab the addressable is addressing in editor, and the only reference to it I have is that addressable

#
    public static T LoadInEditor<T>(this AssetReference assetReference) where T : UnityEngine.Object
    {
        var path = AssetDatabase.GUIDToAssetPath(assetReference.RuntimeKey.ToString());
        return AssetDatabase.LoadAssetAtPath<T>(path);
    }
#

Found this online, might be the solution I need

#

My AddressableReference returns "[]null" and this gets past my null test

#

What is a []null and how do I check for it and stop it?

#

I thought it was maybe a string because its in quotes, but no dice

pale marten
#

noob question...

I understand that 'group' is a unit that is grouped into real files, and 'label' is a unit to find items like tags.
Honestly, this concept doesn't really touch me.
I'm curious about the exact use and difference of group and label.
q1) I want to know when to choose and what to spend.
q2) What does it mean to check "folder" as addressable?
(How sub-folder items are handled, when they are used)

shrewd geyser
#

Groups and labels are really separate concepts, used in different ways.
Groups are mainly used for the build process and how/where the player will load them from, like physically.
Labels are a runtime only concept of what assets you want to load.

A group contains the assets how you structure them and what makes sense for your project. If you have a sword asset with several skins for it, you can group those in a single group, and armor with different skins in a different one, or group all equipment together in a single group. Whatever you choose and how you want the Unity player to load them in (you can customise several settings on a per-group level). If you have assets that need to be available immediately, for example, like several UI or manager objects, then keep them local. If you have end-game levels or monsters, then you can put them in a group that will be downloaded from an external source later and save some disk space for players that haven't reached this end-game content yet. The concept of a group does not exist anymore during runtime, because Addressables doesn't care anymore at that point.

A label determines which asset(s) you want to load at runtime. If you have multiple assets with the same label spread over several physical locations, it will try to (download and) load in those assets (of which it knows about through the catalog file created during build), regardless of how they were grouped.

fervent lintel
#

Does anyone know what I'm maybe doing wrong? I'm using one scene that handles the loading of scenes with addressables; it loads a scene, unloads the previous scene, etc. All works perfectly fine, except for the lighting options. When I open my scene directly in the editor and play it, there is no fog, when I load it through my scene handling scene, there is suddenly a fog. The scene handling scene has no fog, but the unloaded scene did. Is it not unloading the lighting settings?
Edit: It's actually making the light less intense, rather than doing anything with the fog

lilac linden
#

How to make sure addressables load on game release? Game runs perfectly in editor mode, but when I compile the release, some addressables (textures) won't load at all.

#

Is there some catch that I didn't know?

wicked frigate
#

After I finish preloading an addressable, what is the syntax to then instantiate it?

    public static void PreloadTransition(AssetReference room)
    {
        Addressables.LoadAssetAsync<GameObject>(room).Completed += ObjectLoadComplete;
    }

    private static void ObjectLoadComplete(AsyncOperationHandle<GameObject> obj)
    {
        if (obj.Status == AsyncOperationStatus.Succeeded)
        {
            //Instantiate happens here.
        }
    }```
Would I use the regular Object.Instantiate in this context?
wicked frigate
# mild flax correct

It's now tomorrow and I find myself needing to make that exact check. 💦
I got instantiation from addressable working, but now I need to make sure I dont instantiate a room that already exists

#

someone online suggests a dictionary of assetreference, gameobjects. Ill try that

wicked frigate
#

The net says absolutely DO NOT use Object.Instantiate, but it doesnt say what I SHOULD use in its place

mild flax
shrewd geyser
# wicked frigate The net says absolutely DO NOT use Object.Instantiate, but it doesnt say what I ...

We use just Object.Instantiate to instantiate Addressable assets. It's just that the automatic unloading mechanism won't know about it, and you'll have to release manually when you know you're done. It's not wrong to use it, it's just a bit more work to keep track of what you're doing.
In our case, we had a big project already which we were switching over to Addressables, and we already kept track of what was loaded in, so we kept doing it, since this approach translated really well to Addressables.

oak olive
wicked frigate
#

I've been working Addressables into my game and I got it working stable in editor. I did a build to test it and I got this error in build but not in editor.
I'm not 100% sure what it's saying but it looks like its saying it failed to load the addressable?

#

This is the first build I've built with addressables so I assume I must have missed a initialization step when you add addressables to the project maybe?

#

Do addressables need to be in a special folder like how Assets/Resources do?

#

I found a link online but I cannot find this "addressables" menu with mode selection. I went through Window>Asset Management> all the addressable window options, but none of them were just flat 'Addressables'

#

hmm the net says "Window > Asset Management > Addressables) "

#

Im guessing the online resources are out of date? because that isnt a window that can be opened on latest unity

#

I keep finding reference to an "addressables" window but I dont seem to have that window

#

I found this but Im struggling to parse what im supposed to do from it

#

I've read this block 4-5 times but my brain cant seem to grasp what Im supposed to do to get this in my project happening

#

I dont mind it taking longer to make builds, but how do I actually make it do that?

#

I guess my question at the end of all this is:
How do I make it build automatically when I make a normal unity build? I cant find a straight answer online that says "do X"

wicked frigate
#

my asset settings seems to be missing some data compared to the doccumentation?

#

As far as I know I am on latest

#

It looks like the setting I need is under "Build" but I don have build UnityChanThink

#

hmm

#

im NOT on latest

#

im on 1.16.9

#

but there is no option to update

#

Im not the only one with this problem it seems

#

the changelog on addressables says there are tons of stable not preview releases after what I am on so I am not sure why I can't update?

#

I found out how to update to latest

#

but the option -still- isnt there

#

there is supposed to be a check box for "build addressables content on player build"

#

unity never makes things easy

#

How do I build my addressables automatically when I make a player build?

#

I feel like I am taking crazy pills

#

same version, same setting object, completely different settings to what the doccumentation says should exist

#

oh im on 2020 thats why I cant find it :|

#

"Building Addressables on Player Build requires Unity 2021.2+. In earlier versions of Unity, you must build your Addressables content as a separate step."

#

now I have to figure out how to do this "separate step" automatically when I make a build

#

woo okay I am in buisness, found a script online that does it

#

I am getting a big lag spike in Build and in Editor when I run Addressables.InstantiateAsync(room).Completed += loadComplete =>
I have never used the Profiler before so I am not sure what its telling me to tell what is causing the lag spike however. It appears its related to physics callbacks maybe?

wicked frigate
#

hmm if im reading this right, InstantiateAsync isn't being async, its sitting and waiting for it to finish loading?

#

which is what I feared is happening

#

I get a huge lag spike when I call LoadAssetAsync, I am not even instantiating it, just loading it alone, In Build (but also in editor)

wicked frigate
#

hmm even this causes a big lag spike at 5s

#

I think I solved it

#

there is a large lag spike associated with running LoadAssetAsync for the first time

#

if I run it, loading a blank prefab, at start, all subsequence calls of that method cause no lag spike, regardless of the size of the thing being loaded

wicked frigate
#

Doing that made it work, I solved it in the end, no lag anymore

wicked frigate
#

I have a dictionary of my instantiated addressable rooms, I am using AssetReferences as keys, and the instantiated room as values

#

but for some reason, 50% of the time when I pass in the AssetReference, it returns null

#

when it sees null room, it assumes the room has not been spawned, spawns a new room, and then logs it with the AssetReference/Spawned room

#

when I debug log the contents of the dictionary, I can see there are multiple of the same room spawned, and using the same identical AssetReference key

#

I can't figure out why it returns a null when logging shows the same identical AssetReference Key saying there IS a room to return

#

I say 50% of the time because I use this code in two places, and I dont know why but identical asset references as key, the same copied value, will return the room in one place, but wont return the room in the other place, and I cant figure out why

wicked frigate
#

when I debug log an AssetReference, this is what I get

#

but when I thing == thing them, they are not returning as equivalent

#

for now, I am doing AssetReference.ToString(), because that DOES return as equivalent

#

are there unforeseen circumstances to this solution/action?

wicked frigate
#

Hmm

#

My ToString sollution didnt work

#

it worked sometimes, but after further testing, the strings dont always align

#

I need some way to pair up asset references with instantiated objects in a dictionary that is no fail

#

thus far every attempt hasnt worked

#

Okay I have no idea whats going on, because now I cant reproduce the dictionary not returning

real plover
#

is addressable normally take that long? sorry, first time I use this package

real plover
#

I have restart twice

#

I mark this folder and dotween folder, then press build in addressable window

hard wave
#

im trying to simulate my game on my phone, i have already built it and opened it in xcode but when i try to pick a simulator it gived me no options:

marble bay
#

Hey guys, how come this "Completed" in Editor fast but takes forever in WebGL build?

#
        
        Debug.Log("Start Initializing");
        
        Addressables.InitializeAsync().Completed += (handle) => {
            
            Debug.Log("Initialization " + handle.Status);
            initialized = true;
            
        };
    
    }```
wraith edge
#

Also make sure to actually use the addressable bundle in editor to have closer behaviour to build, as editor has several modes for using them

marble bay
#

Thanks for response! So I am currently using ngrok to serve my WebGL file for testing and as soon as I switch to GitHub pages the issue goes away and it Completes the initialization almost instantly...

wraith edge
#

Browser networking tools can help to show what is going on

#

Be mindful of browser caching too

marble bay
#

I use Chrome, any ideas what to look in?

wraith edge
#

Well you can watch stuff load live in the networking tab, which would give some indication of download speed

#

Also shows caching status

marble bay
#

Is this it?

wraith edge
#

Settings and catalog are more informational. Big files after them are likely your bundles.

marble bay
# wraith edge Settings and catalog are more informational. Big files after them are likely you...

Yeah but I'm not loading the bundles yet, just trying to Initialize Addressables first...I was having the delay issue with just downloading the catalog instead of initializing so that's why I thought maybe I should initialize first then download later so it could be faster. With this test I realize the downloading wasn't actually what was causing the issues (the catalog files are tiny as heck probably less than 1 mb so that couldn't be the issue I thought)...

wraith edge
#

Oh I see, yea that's quite odd

wicked frigate
#

How do I find an AssetReference through code?

#

I have an addressable I need to spawn but I don't know in advance what it is, I need to find it at the moment of

wicked frigate
#

How do I assign to this field from code?

#

my failed attempts to do so

#

editing SerializedProperty directly failed, editing with set dirty failed

#

this also didnt work

wicked frigate
#

im really struggling here

#

I need to use addressables to load a room on start up

#

but I dont have an asset reference to that room

#

I have a regular old game object reference, which I need to convert into an asset reference, or store the asset reference to itself in the game object of itself

#

and I want to do this all through code, not inspector

low halo
wicked frigate
low halo
wicked frigate
wicked frigate
low halo
#

I'm just failing to see how addressables are involved at all in this case

wicked frigate
#

I have reference to the prefab but I dont know how to get the addressable reference to the prefab in the project

fickle drum
#

<@&502880774467354641> found an issue with addressable 1.19.17 - and 1.19.19 -> when used instantiate Asset from Project inside the Script of the Addressable Asset ( Addressable Prefab with custom script) -> after first release of this Addressable Asset -> Secondary instantiations of the Addressable Asset Prefab and instantiating Asset Prefab from Project -> causes the Asset Prefab from Project to lose TMP font material as well as custom sprite/textures on the UI. What should I do?

fervent arch
#

You could start by not pinging the admins 🤦

bold pike
tender cliff
#

Not sure where to start with this:
I have an APK submitted to Google Play. In their testing it is reported to have API warnings:
StrictMode policy violation: android.os.strictmode.NonSdkApiUsedViolation: Ljava/lang/invoke/MethodHandles$Lookup;-><init>(Ljava/lang/Class;I)V
at android.os.StrictMode.lambda$static$1(StrictMode.java:428)
at android.os.-$$Lambda$StrictMode$lu9ekkHJ2HMz0jd3F8K8MnhenxQ.accept(Unknown Source:2)
at java.lang.Class.getDeclaredConstructorInternal(Native Method)
at java.lang.Class.getConstructor0(Class.java:2325)
at java.lang.Class.getDeclaredConstructor(Class.java:2166)
at bitter.jnibridge.JNIBridge$a.<init>(Unknown Source:25)
at bitter.jnibridge.JNIBridge.newInterfaceProxy(Unknown Source:8)
at com.unity3d.player.UnityPlayer.nativeRender(Native Method)
at com.unity3d.player.UnityPlayer.c(Unknown Source:0)
at com.unity3d.player.UnityPlayer$e$2.queueIdle(Unknown Source:72)
at android.os.MessageQueue.next(MessageQueue.java:395)
at android.os.Looper.loop(Looper.java:160)
at com.unity3d.player.UnityPlayer$e.run(Unknown Source:32)
My question asking for a hint as to where to start looking at this or reproducing it. I am guessing Android studio is the environment? TIA.

tender cliff
#

The next report shows Landroid/media/AudioSystem;->getPrimaryOutputFrameCount()I
I am thinking an audio asset is at fault. My app doesnt have any audio in it but there could be a disregarded/unaddressed listener on some game object.

marble bay
honest hearth
#

With addressables and assetbundles, I am trying to put in for example terrains, most of the assetbundles im using atm work fine, but when i tell it to load a terrain for example from assetbundle, I dont get any errors, and in inspector shows it loaded it, but the rotation is way off, and its not showing in the scene

#

shows the terrain file is attached, and everything is on, but the terrain prefab its loading has 0 pos and rot when loaded as a bundle it gets weird rotations and isnt visible, if i click the terrain paint aspect shows the terrain layers and stuff

modern scroll
#

Is there any way to split asset bundles into multiple catalogs. I want some bundles to be in the install folder, and other bundles to be in a different folder. Is the only way to do this to have two different profiles that build some of the bundles each

marble bay
#

Can someone tell me why I have issues with my URP shader built with ShaderGraph? It doesn't work when instantiated with Addressables...

#

It looks like this:

#

Vs what its supposed to look like:

#

So the effect is blank in the first picture...what could the issue be?

viscid quail
#

hello. is there a way to change the load path at runtime after initialize?

undone hound
#

I've seen it mentioned on the forums somewhere

marble bay
# marble bay

Nvm, there was no issue. It was my fault cause I had 2 similar objects and the main one was disabled through code and I forgot...ugh..

slate timber
#

Is it possible to generate one set of addressables that can support multiple platforms? I.e. I'm building for WebGL, Android, iOS & Windows. I have to execute the addressable build 4 times to support them all.

#

(This is part of a daily dynamic build that changes content and takes about 3 hours to complete)

oblique swift
#

had 3d addressable objects in a project and it vanished from my hub when i open there is nothing there only the sample Scene . is this possible?

#

I think I will go back to build binary save and loading system by myself until all the addressable thing will be more simple and reliable.

mental lily
#

UnauthorizedAccessException: Access to the path is denied.
What the hell is this, where does it come from, how can one get rid of it?

#

Comes up randomly and I really can't get my head around it. Freshly built asset groups. nothing weird happening on build pre/post process

#

But I couldn't find anything about this error anywhere on the internet :/

wooden moss
mental lily
#

sometimes it works, sometimes I get that error

#

it has nothing to do with running as admin

violet scarab
#

anyone know why the wheels going through the ground but stopping at the box collider of the car?

violet scarab
#

fixed it

#

i didnt fix it i just made the box collider of the car bigger but it did the trick

worldly moon
#

I'm trying to get some insight on what would the correct pattern would be for an Items system. Starting with an enum of ItemIds, each item prefab holds one of these ids, the way I see it right now I have two options either:

1 - Make sure the address is something like "Items/[itemId]" and when I need an item, do a LoadAssetAsync. Which seems weird and kind of prone to error, having to make sure the strings match both in the enum definition and in the address.
**2 - **Loading all addresses with the "Item" label on startup, and mapping them to a Dictionary<ItemId, AssetReference>, which seems a bit overkill maybe? And is a whole process on boot?

Maybe I'm overthinking it, or there is even a completely different approach I'm not seeing. In any case, I would appreciate any insight on this

umbral locust
#

Is this issue connected to the adressables ?

01-27 23:40:16.089 31919 32137 E Unity   : MissingMethodException: Default constructor not found for type UnityEngine.ResourceManagement.ResourceManager+CompletedOperation`1[[UnityEngine.GameObject, UnityEngine.CoreModule, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null]]
01-27 23:40:16.089 31919 32137 E Unity   :   at System.RuntimeType.CreateInstanceMono (System.Boolean nonPublic) [0x00000] in <00000000000000000000000000000000>:0
01-27 23:40:16.089 31919 32137 E Unity   :   at System.Activator.CreateInstance (System.Type type, System.Boolean nonPublic) [0x00000] in <00000000000000000000000000000000>:0
01-27 23:40:16.089 31919 32137 E Unity   :   at UnityEngine.ResourceManagement.Util.LRUCacheAllocationStrategy.New (System.Type type, System.Int32 typeHash) [0x00000] in <00000000000000000000000000000000>:0
01-27 23:40:16.089 31919 32137 E Unity   :   at UnityEngine.ResourceManagement.ResourceManager.CreateOperation[T] (System.Type actualType, System.Int32 typeHash, System.Int32 operationHash, System.Action`1[T] onDestroyAction) [0x00000] in <00000000000000000000000000000000>:0
01-27 23:40:16.089 31919 32137 E Unity   :   at UnityEngine.ResourceManagement.ResourceManager.CreateCompletedOperation[TObject] (TObject result, System.Boolean success, System.
lunar garnet
#

I am very new to addressables, but would like to understand how I can use addressables to solve adding custom animations into my game after release. Something like what Fortnite did, I need to find a way to add more custom animation into the main character's animator controller, and access them via code without knowing what those animations are.

#

Are there any working examples of this in action I can review?

#

I am currently using asset bundle to load the animation and other custom clips, but would like to give addressables a try.

marble bay
# lunar garnet I am currently using asset bundle to load the animation and other custom clips, ...

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.

#

For the animations, I would retrofit the Texture loading section of the tutorial for animations instead...

lunar garnet
#

Thanks! I'm researching on another problem regarding of Unity's animator and how I could load custom animations at runtime. It seems like I'll have to use a plugin called animancer to resolve that.

marble bay
lunar garnet
#

All good. I'll read the article you sent me. Thanks!

marble bay
#

Now for people more adept at Addressables than I am can someone give me the basic anatomy of the files I need when loading from a remote server? The problem is I don't know what files I need to delete from remote server and what to keep when I make changes to the Addressables group. When to build the whole project again vs when to not to (and just build the Addressables group instead)...any help?

#

These are the files I have:

#

The craftastechlogo_assets bundle file I know is what gets updated with catalog but what is the "faad2dab2f6d33164579cd0" bundle file?...

#

And what are the catalog files there?

torpid crescent
#

either upload it on server or cache and reuse is fine

marble bay
torpid crescent
#

if catalog changes then you need to upload it

#

it is used to access the files

#

if it's not on the catalog, you can't access it

marble bay
#

What do you mean changes? New stuff added to addressable groups?

torpid crescent
#

you don't have to upload it, but you don't have to upload anything either 😛

#

what I meant is that you could ship it together with the build if you want to

#

... I think

torpid crescent
marble bay
torpid crescent
#

there should be a 'build content' and a 'update content' option

#

use the 'update content' when you're updating content

#

also, ignore everything I told you about the catalog.. just upload it too

dense cosmos
#

Hello. I'm fairly new to addressables and wanted to ask what is the best way to separate catalogs that are in the dev environment vs production.
I understand that if I build my project with a certain Profile selected, that build can only load assets from one RemoteLoadPath (hosted on a CDN).
So if I wanted to make a dev build to hand over to my beta testers, I would have to build my game using a different profile that has a different RemoteLoadPath. Is this the best way to separate dev catalogs/bundles and production ones?

Update: I found a section of the documentation that answers my question: https://docs.unity3d.com/Packages/com.unity.addressables@1.18/manual/BuildingContent.html

dense cosmos
marble bay
torpid crescent
#

yes :p

torpid crescent
#

and use the same catalog, if you wish

marble bay
# torpid crescent yes :p

So I'm basically replacing all the files then. So process is upload new files, then delete old files?

torpid crescent
#

that's what I'm doing

#

(actually it isn't but you didn't seem to like what I said about the catalog files xD)

marble bay
#

I just need to know the proper process...

#

What files never (?) get reuploaded vs what files that do...

torpid crescent
#

do you know how to access addressables?

#

@marble bay

marble bay
torpid crescent
#

like.. instantiate

#

how to get a reference to the asset file in Unity

marble bay
#

Yes, I've been using it in my tests after I build the project...

torpid crescent
#

cool, then how do you do it?

marble bay
#

I use it as Asset Reference...

#

Then instantiate it...

torpid crescent
#

I see

#

what if you didn't use AssetReference?

#

you know how you could access it?

marble bay
#

I currently store my prefab in the Asset Reference variable from the inspector...

torpid crescent
#

alright

marble bay
torpid crescent
#

so, the AssetReferences come from the catalog

#

so you could have the catalog contained in the built (resources folder or w/e), so no need to upload it

#

now.. the catalog links the AssetReference to an asset, when you first 'load' it (be it either Addressables.Instantiate or Addressables.Load())

#

the link usually points to a server (or a local path, depending on your addressable build settings)

#

so, you don't really need to upload anything to a server..

#

now if you DO want to use a server, you can either upload the catalog or don't

#

-- based on if you prefer to have your catalog included in the build, or accessed via your server

#

the '.bundle' files need to be re-uploaded regardless

#

NOTE: not ALL .bundle files will need to be re-uploaded each time you 'Update content' (since the catalog contains the same links)

#

but to be safe, you can just upload and replace everything

#

NOTE: if you DON'T Update content, but REBUILD instead, your AssetReferences will be lost, so you'll need to both update them and your server files

#

@marble bay makes sense?

marble bay
#

So after I build my addressable group, never rebuild? Just update?

torpid crescent
#

optimally, yeah

marble bay
#

Doesn't Unity automatically build the addressables groupd when I build my project again?

torpid crescent
#

that 'build' is just an export of what's currently in

#

it's not a full rebuild

marble bay
#

We need to pin your posts up top for this thread lol, i need to come back to it!

torpid crescent
#

I'll ping one of the mods to do it once someone confirms it's correct info lol 😄

#

not 100% sure about AssetReferences being lost since I don't use them, just read something of the sort and been avoiding them since 😛

marble bay
#

Thanks though!

marble bay
worldly moon
#

I'm trying to get some insight on what would the correct pattern would be for an Items system. Starting with an enum of ItemIds, each item prefab holds one of these ids, the way I see it right now I have two options either:

1 - Make sure the address is something like "Items/[itemId]" and when I need an item, do a LoadAssetAsync. Which seems weird and kind of prone to error, having to make sure the strings match both in the enum definition and in the address.
2 - Loading all addresses with the "Item" label on startup, and mapping them to a Dictionary<ItemId, AssetReference>, which seems a bit overkill maybe? And is a whole process on boot?

Maybe I'm overthinking it, or there is even a completely different approach I'm not seeing. In any case, I would appreciate any insight on this (edited)

undone hound
torpid crescent
#

probably got definitions from older package version

undone hound
#

Righto, just making sure I've not missed another way to update the catalogue

undone hound
# marble bay So after I build my addressable group, never rebuild? Just update?

Sometimes you have to do a new build of the addressables. I updated the version of Unity for the project, and doing an update catalogue build wasn't enough, had to do a new build. So that users who hadn't updated the app wouldn't get a broken app, I did a new build into a different folder
Original: /ServerData/Android
New: /ServerData/Android_2022325

And have both on the S3 server

marble bay
undone hound
#

We don't yet, but it's very common to do so

#

eg: MP games like Clash Royale

marble bay
#

In terms of how I am using it, its a web app so no downloading, you would load the latest version when you boot up page. Now I am questioning how to remove the old version and what happens if we do when player is in the midst of using the program? Or is that why companies do server maintenance times?

undone hound
#

That, I'm unsure about, I haven't touched addressables in WebGL.

I THINK it wouldn't matter for a user who's already playing when you update.. unless/ until they get to a section that requires a download from the addressables that they haven't already gotten yet

#

Depends when you get the addressables, and if there's any refreshing during gameplay

marble bay
#

Nah, they load the addressable from the beginning...

#

Guess it never hurts to test myself...

wraith edge
#

If you expect extended session times and rapid update cycles, maybe a smarter setup needs to be implemented

marble bay
#

Probably just gonna roll with keeping 2 different catalogs up at a time (oldest and newest) which gets replaced with each new catalog change...

#

But is the system smart enough to load the latest catalog?

#

Or do I have to manually do something here?

untold jewel
#

For anyone who is using the Localization package, what is the best practice for structuring the asset files. I notice that when I create a string table, it puts all the assets in one directory (that you choose) and its flat. Is it possible to move around the assets so it follows a locale language per directory with the table reference in the root or something?

undone hound
#

and doing so, requires a new game build

#

You might be able to get around that by having a json (separate to the addressables) that has a version number + which URL to use. Check this on game load, get the latest URL, and pass that to the addressable system

undone hound
#

setting the string url as pathA or pathB

marble bay
#

Like having two separate folders

#

That point to the Old and New Builds?

untold jewel
#

How does one remove a localization string table used by the localization package? They don't have any documentation on how to remove localization tables/assets the right way. I don't want to manually have to remove stuff in the file system.

untold garnet
#

long downloadSize = Addressables.GetDownloadSizeAsync("LabelTest").WaitForCompletion();
doesn't work in Awake() on 2nd or later android app launches (when the asset bundle is already downloaded from remote) - any idea how to fix?

fringe roost
#

thank you for this old post - it just saved me

true saddle
#

Hi all, in 1.19.17 I'm getting stack overflow on AssetReferenceDrawerUtilities, it's caused by using F-Bound polymorphism to construct a scriptable object that is an addressable.
Something like this:

    public abstract class AddressableObject<TContainer> : ScriptableObject
        where TContainer : AddressableObject<TContainer>

Function causing the issue:

        private static Type GetGenericType(Type t)
        {
            if (t == null)
                return null;
            while (t.GenericTypeArguments.Length > 0)
                t = t.GenericTypeArguments[0];
            if (t.BaseType != null && t.BaseType.GenericTypeArguments.Length == 1)
                t = GetGenericType(t.BaseType);
            if (t.HasElementType)
                t = GetGenericType(t.GetElementType());
            return t;
        }

Is this something known?

misty spear
#

Is there a way to get the asset from an AssetReferenceT<Sprite> in an editor window? I've tried AssetReference.editorAsset but its null

unique olive
#

Hey, new to addressables and assetgroups, I have a quick question. If I were to mark a scene in my project as "addressable", and none of the meshes/textures/sound files/etc. in that scene were referenced elsewhere in that project, would all of the asset grouping for those subassets be 'automatically' handled? Or do I need to maintain explicitly-dictated assetgroups of individual assets separate from that?

marble bay
verbal harness
#

I have a question. Why can't I drag and drop bulk items into a list of AssetReferences like I can with GameObjects and Audiclips? https://youtu.be/-HBXztlxR7k

Rules violated:

  1. consistency: If lists for everything else in Unity allow bulk importing, so should addressables.

  2. Time violation: Should be done in seconds, not minutes or hours

  3. Focus lost: Drag and drop loses focus

  4. Frustration: knowing you're losing time due to lack of consistency is annoying.

Am I doing things wrong? Or did Unit...

▶ Play video
lunar shard
#

Does anyone in here know a good tutorial on how to build and use Addressables without it making Asset Bundles? I'm trying to find a good workflow while iterating on assets, and finding info on this particular part of Addressables seems really difficult.

verbal harness
#

So no one knows how to do traditional group populating of lists of addressables? Then it is a bug on Unity.

wild nova
#

Is there some unique string, int, GUID I can use to reference addressables at runtime?

wicked plover
#

Hi everyone, I currently finding a way to load my assets remote, because of the limit of the google store (150mb), I think addressable is a good way, so my question is, I can make my assets (textures under Resources folder) as addressable assets and then in the app download the assets, and I can still use "Resources.load" to load my assets as usual?

proud tendon
#

That's a problem with asssetReference type when they are a list

unique olive
#

This isn't really a problem with addressables. If you're ever in a situation where you have one object loaded and 98 from the same bundled unloaded, your asset bundles are set up wrong. With addressables it's pretty straightforward to set things in discrete bundles.

#

Also, addressables are asset bundles. It isn't either/or. And you should never use Resources.

crude dock
#

Hi, I'm looking for a cloud solution to store Addressables remotely, and i'd like to know if someone uses DigitalOcean solution or AWS to do this, and if so, what do you think about it ?

wide plinth
#

I started to work on upgrading my project to use Addressables. I was using Addressables thanks to Localization package before.
I'm trying to do it correctly, that's why I'm using Addressables Event Viewer. It's very messy though, because of multiple "GetTableEntryOperation" that are caused by LocalizeStringEvent. I don't know why some of them get unloaded when destroying gameobject, but some of them stay in memory even when I remove whole prefab or switch the scene. Should I somehow release it from memory by myself?

ivory gorge
#

Hi, I'm using Addressable to load assets from cloud, when I call API Addressables.CheckForCatalogUpdates, always return result is 0.
How to use Addressables.CheckForCatalogUpdates correctly?.
Thanks!
Ref: https://forum.unity.com/threads/how-to-fetch-latest-catalog-and-re-initialize-addressables-in-runtime.544125/

wicked frigate
#

I am getting a weird bug with Addressable that I'm having trouble nailing down the source of.

In a pc Build, not in Editor, I am using a render texture as part of a visual effect. The Render Texture is populated from a camera.

If I drag a prefab into the scene, the render texture works as expected, however if I instantiate that same prefab through an AssetReference, the render texture returns black

#

I've carefully compared every single thing within the Addressable instantiated room vs. dragging it in manually, and I can't find a single difference between the two that could answer why the render texture is black in any of the addressable prefabs

#

Is it possible that something is being done to the sprite renderer that is in the scene at launch that isn't being done to the sprite renderer when the addressables instantiates the prefab?

wintry karma
#

Should we handle caching for addressable assets ourselves?

#

I mean if we do not handle it, they are downloaded completely every time?

public IEnumerator Start()
{
    string key = "assetKey";
    //Clear all cached AssetBundles
    // WARNING: This will cause all asset bundles to be re-downloaded at startup every time and should not be used in a production game
    // Addressables.ClearDependencyCacheAsync(key);

    //Check the download size
    AsyncOperationHandle<long> getDownloadSize = Addressables.GetDownloadSizeAsync(key);
    yield return getDownloadSize;

    //If the download size is greater than 0, download all the dependencies.
    if (getDownloadSize.Result > 0)
    {
        AsyncOperationHandle downloadDependencies = Addressables.DownloadDependenciesAsync(key);
        yield return downloadDependencies;
    }

    //...
}
mild flax
wintry karma
# mild flax No - cache is handled for you.

Thanks. Another but related question.
Does the code below work for addressable localization assets?
I have several addressable localization assets for each locale/language and I would like to download them individually

LocalizationSettings.StringDatabase.GetTableAsync(_tableRef, locale);
wide plinth
#

I' using Photon Fusion and now I'm trying to implement Addressables. When I initialize my MP game I load my chapter prefab, if player is a host (or plays single player mode) I have to spawn networked prefab in Completed callback, just like this:

        {
            Debug.Log ("Spawn for host and single");
            roomHandle = Addressables.LoadAssetAsync<GameObject> (string.Format ("Room_Chapter{0}", chapterId));
            if ((Runner.GameMode == GameMode.Host || Runner.GameMode == GameMode.Single) && Object.HasStateAuthority)
            {
                roomHandle.Completed += loadedRoom => SpawnChapter (loadedRoom.Result);
            }
        }

        private void SpawnChapter (GameObject room)
        {
            Debug.Log ("Spawn Chapter");
            Runner.Spawn (room.GetComponent<NetworkObject> ());
        }```

What is weird, that first debug in InitializeGame gets called once, but the one in SpawnChapter is called twice. What can be the reasone that Completed gets invoked twice? Guys from Fusion say that it's not on their side.
rancid pasture
#

Hello im really new to addresables, any tutorial for starting ?

mild flax
#

^These aren't the same and so far as I've found there's no way except a long clumsy switch statement

rancid pasture
#

Hi, is there anyone that can helpme out with addresables?
Im trying to use "DownloadDependenciesAsync"
But cant get it to work

rancid pasture
#

IGot it Working!, but now I am ruuning in to this: How can I check if a certain AddresableAsset has been previously loaded, has a pending update or is missing and wiling to load?

warped tree
#

Does anyone know why the Addressables tick doesn't show up on my ScriptableObjects?
I have the latest verified package version installed in the latest LTS version of unity.

#

It does show up on Prefabs

#

Package version

#

Unity version 2020.3.30f1

#

In case it matters, the PreloadSettings ScriptableObject is in a different assembly definition, but said ASMDEF does reference Addressables.

hexed shell
#

is it an editor-only SO

warped tree
#

It's not, but it does not have a [CreateAssetMenu] attribute.

hexed shell
#

hrm, what does the assmdef look like?

warped tree
#

Hmm, how about that, it says No asset usages in the IDE.

#

That does reference UnityEditor.UI, but that's all stripped out at runtime using #if UNITY_EDITOR

hexed shell
#

I've never done that before, but I'll take your word for it. Have you tried restarting Unity? Maybe it just needs a kick to get addressables to notice the type

warped tree
#

Nope that didn't fix it, unfortunately.
I guess I'll try separating the code into separate assemblies for the runtime and editor. Bit of a pain but oh well.

hexed shell
#

Can you drag it into the addressables groups window?

warped tree
#

How about that... I can't open that menu

#

Even after switching to a preview version it doesn't show up, odd...
I'll have to look further into that.

warped tree
#

The answer is I'm and idiot and you were right.

I placed it inside an Editor folder for some reason, so it was an editor-only SO Instance.
I thought that only was the case for the script compilation but turns out it doesn't.

hexed shell
#

Oh, the SO itself was in an editor folder?

warped tree
#

The instance yeah, not the script.

hexed shell
#

Interesting. Glad you figured it out

warped tree
#

Thanks for the help!

#

Still no Groups window though, but that's not too much of an issue rn for me.

hexed shell
#

That's annoying, the groups window is pretty important imo

cursive mulch
#

So the doc says InstantiateAsyc "This cannot be used a second time until the first load is released". But in the example of addressable, SpawnThing() can be call multiple times continuously. Can someone explain for me what i miss?

lunar shard
#

Is there a way to control the internal names of asset bundles generated by Addressable builds? It seems like it creates big, crazy long, obtuse, unique hash names, correct?

lunar shard
#

here's an example of what I am talking about

#

as far as I can tell, Addressables auto generates these without any documentation as to how or what the names mean

lunar shard
#

sadly no, those set the external names of asset bundles

#

basically only the filenames

#

internally, asset bundles have different names

lunar shard
#

here's an example using the Asset Bundle Browsing tool to read the internal data of an Asset Bundle made by addressables

#

it gives the internal Name field a hash (which is different than the hash Addressables can append to the filename), and then the Dependency names are also different from both the Name field hashes and also generated somehow and for some reason.

#

assets_example_a7001bddbca3a53b33baf95c5ba52b07.bundle this is the filename of the assetbundle, and it is what Bundle Naming Mode controls.

#

I am sure there is code somewhere in the Addressables source code for controlling this, it just appears to not be exposed to me as a user unfortunately. So, I'll have to write my own custom build script or go hunting for it to modify it I suppose.

tame moss
#

Unity Tip

#

UI will scroll through if you input anything on the horizontal and vertical axis

#

to disable this just make a blank input in player setting and assign it to the horizontal and vertical axis

formal shore
#

is there a way to abort all LoadAssetAsync? i'm currently implementing some tests of monobehaviours that use addressables and i get errors because i quickly destroy some of them while they are still waiting for addressables to load. This causes the completed callbacks to trigger after the object is already destroyed

lunar shard
formal shore
lunar shard
#

if the MonoBehaviours are storing the addressables, you could have them stop during the OnDestroy method

cursive mulch
#

Anyone knows how to Load Scene with Physics mode in Addressables, it seems like Addressables.LoadSceneAsync don't allow Physics mode parameter.

hot shadow
#

Hi, How can I fix download bundle file name if I work in difference machine?

minor tinsel
#

The InternalId of the IResourceLocation contains the scene path

cursive mulch
minor tinsel
# cursive mulch It sounds like a great way to work around this problem. Thank you a lot.
// Find all of the possible locations for the scene
IList<IResourceLocation> locations = await Addressables.LoadResourceLocationsAsync(sceneName, typeof(SceneInstance)).Task;

// Retrieve the scene path
string scenePath;

if (Addressables.InternalIdTransformFunc != null)
    scenePath = Addressables.InternalIdTransformFunc(locations[0]);
else
    scenePath = locations[0].InternalId;

// Load it normally
SceneManager.LoadSceneAsync(scenePath, new LoadSceneParameters
{
    loadSceneMode    = LoadSceneMode.Single,
    localPhysicsMode = LocalPhysicsMode.None
});
#

something like this basically

cursive mulch
cursive mulch
#
              AsyncOperationHandle<IList<IResourceLocation>> loadHandle = Addressables.LoadResourceLocationsAsync(additiveScene, typeof(SceneInstance));
                    // loadHandle.Completed += OnFindLocationsForScene;
                    yield return loadHandle;
                    IList<IResourceLocation> locations = loadHandle.Result;
                    string scenePath;
                    Debug.Log($"OnFindLocationsForScene : {locations[0].InternalId}");
                    if (Addressables.InternalIdTransformFunc != null)
                    {
                        scenePath = Addressables.InternalIdTransformFunc(locations[0]);
                    }
                    else
                    {
                        scenePath = locations[0].InternalId;
                    }
                    Debug.Log(scenePath);
                    yield return SceneManager.LoadSceneAsync(scenePath, new LoadSceneParameters
                    {
                        loadSceneMode = LoadSceneMode.Additive,
                        localPhysicsMode = LocalPhysicsMode.Physics3D
                    });
#

@minor tinsel So I implemented based on your code, it got the scenePath correctly but there is runtime error at SceneManager.LoadSceneAsync

minor tinsel
#

Hmm, you'll need to load the related bundle

#

Okay so, it looks like what you need to do is get the IResourceLocation's dependencies and load them

minor tinsel
cursive mulch
minor tinsel
#

That's odd, that's basically all the built-in scene load stuff does

#

oh hmm

#

one sec

minor tinsel
cursive mulch
#

still doesn't work, it never gets to that LoadAssetAsync because HasDependencies returns False

minor tinsel
#

That's... weird

#

since that's what the addressables API does

#

oh lol I think I see the problem

#

it should actually work in a build, but there's something else you have to do in the editor

#

one sec

#

@cursive mulch

var handle = Addressables.LoadResourceLocationsAsync(additiveScene, typeof(SceneInstance));
yield return handle;
var location = handle.Result[0];
string scenePath;
#if UNITY_EDITOR
bool bundle = false;
#endif

if (Addressables.InternalIdTransformFunc != null)
    scenePath = Addressables.InternalIdTransformFunc(location);
else
    scenePath = location.InternalId;

if (location.HasDependencies)
{
    var depHandle = Addressables.LoadAssetsAsync<IAssetBundleResource>(location.Dependencies, null);
    yield return depHandle;

#if UNITY_EDITOR
    foreach (IAssetBundleResource resource in depHandle.Result)
    {
        if (resource != null && resource.GetBundle() != null)
        {
            bundle = true;
            break;
        }
    }
#endif
}

var parameters = new LoadSceneParameters
{
    loadSceneMode    = LoadSceneMode.Additive,
    localPhysicsMode = LocalPhysicsMode.Physics3D
};

#if UNITY_EDITOR
if (bundle)
    yield return SceneManager.LoadSceneAsync(scenePath, parameters);
else
    yield return EditorSceneManager.LoadSceneAsyncInPlayMode(scenePath, parameters);
#else
yield return SceneManager.LoadSceneAsync(scenePath, parameters);
#endif
cursive mulch
minor tinsel
#

It's kinda ridiculous that Addressables doesn't already expose this functionality lol

orchid pier
#

Hey guys, for a solo dev working on a medium sized game, is it worth investing time to work with addressables when the game is at 20% progress or later on at 60-80%?

I am beginning to understand the value, but i think it adds way more friction at the early stages.

swift birch
#

I need to create WebGL and Standalone builds which use Addressables. However, the standalone builds need to load local bundles and WebGL needs to load remote only. How would you do this? The build/load paths are set per group, but you can’t have the same assets in two different groups…

Hmmm, is it bad practice to set the remote build and load paths in the profile to the local paths? That should solve this issue, but it seems like this might not be the intended use

cursive mulch
minor tinsel
cursive mulch
hot shadow
#

How can I config unity addressable in difference machine can download same build file?

hot shadow
#

Why addressable not support asset bundle file that build from difference "addressable_content_state.bin" on remote mode?
I mean same unity project but difference project folder location.

lilac linden
#

I'm getting the error "Exception: Attempting to use an invalid operation handle"
` public async Task<Sprite> Load()
{
_handle = assetReference.LoadAssetAsync<Sprite[]>();
_value = await _handle.Task;

  return Value;
}`
#

The other part is that calls load is:
public async Task SetSprite(Sprite3DResource sprite) { _sprite.Release(); _sprite = sprite; _renderer.sprite = await _sprite.Load(); }

#

any clue on what I'm doing wrong?

#

to make it clear, it gives the error as soon as the game is on, because it has:
private async Task OnEnable() {await SetSprite(_sprite);}

#

private void OnDisable() {_sprite.Release();}

#

Release code is as follows:
public void Release() { if (_handle.IsValid()) {Addressables.Release<Sprite[]>(_handle);} }

minor tinsel
#

My gut tells me that the first one will be faster, because the second one will always have to resolve the instance in some way even if it caches it

#

Whereas with option 1, you resolve the instance once and have it right there

cursive mulch
minor tinsel
#

I might've missed something while looking at the internal logic

#

I'm not familiar with remote loads so I wouldn't be surprised if that were the case

#

Looks like the only other thing it does is modify the path when in the editor

#

try changing

#if UNITY_EDITOR
if (bundle)
    yield return SceneManager.LoadSceneAsync(scenePath, parameters);
else
    yield return EditorSceneManager.LoadSceneAsyncInPlayMode(scenePath, parameters);
#else

to

#if UNITY_EDITOR
if (bundle)
    yield return SceneManager.LoadSceneAsync(scenePath, parameters);
else
{
    if (!scenePath.ToLower().StartsWith("assets/") && !scenePath.ToLower().StartsWith("packages/"))
        scenePath = "Assets/" + scenePath;

    if (scenePath.LastIndexOf(".unity") == -1)
        scenePath += ".unity";

    yield return EditorSceneManager.LoadSceneAsyncInPlayMode(scenePath, parameters);
}
#else
#

Aside from that, everything appears to be identical to how Addressables.LoadSceneAsync works

cursive mulch
#

oh my mistake for making it clear, I tested on build version, not editor version. Editor works fine for me.

sharp crow
#

how can I get a list of keys for assets with a certain label

#

I can LoadAssetsAsync with "MyLabel" but then I only have prefabs without the original key they had

#

var loadResourceLocations = Addressables.LoadResourceLocationsAsync(new[] { "MyLabel" }, typeof(GameObject)); does not return anything

#

hmm weird. it works now

#

not working: var loadResourceLocations = Addressables.LoadResourceLocationsAsync(new[] { "MyLabel" }, null);
working: var foo = Addressables.LoadResourceLocationsAsync("MyLabel", null);

#

any idea why?

#

it also returns 5 identical primarykeys per entry

minor tinsel
#

It's possible maybe it needs a bundle and it's not being loaded or something

minor tinsel
#

Hmm, what if you log the scene path, does it look valid?

#

Could also enable this part in a build and log if each bundle loads correctly:

#if UNITY_EDITOR
    foreach (IAssetBundleResource resource in depHandle.Result)
    {
        if (resource != null && resource.GetBundle() != null)
        {
            bundle = true;
            break;
        }
    }
#endif
#

As far as I can tell this should be functionally identical to Addressables.LoadSceneAsync so there must be something subtle I'm missing

cursive mulch
#

The log looks valid

#

I try a build with local load option and it works fine btw. Just something wrong with remote

minor tinsel
#

Yeah, that is really strange

#

And Addressbles.LoadSceneAsync works perfectly fine with remote?

#

Also which version of the addressables package are you using? Maybe I was porting code from an incompatible version or something

#

Gotta step away for a bit to get some stuff done IRL, but if you'd like I'll ping you when I get back to investigate further

cursive mulch
cursive mulch
minor tinsel
#

@cursive mulch Interesting, I made that function by reading version 1.19.17's code

#

So maybe 1.18.19 has differences

minor tinsel
#

Hmm, appears to be the same, though I suppose there is one thing I missed when translating the code

#

I noticed that the code still iterates over the bundles and calls GetAssetBundle even in builds, so maybe that actually loads them

minor tinsel
#

awesome

slender jay
#
  1. Questions about Addressable
  2. How to perform the hot update of Addressable
  3. How to set the Shader variable of SceneView camera
  4. The reason why Activity defaults to SingleTask
  5. About the Resources.UnloadUnusedAssets call time is too long
    Questions about Addressable
    https://blog.en.uwa4d.com/2022/01/20/questions-about-addressable/

We have two layers of cognition on Assets: one layer comes from Unity’s default project directory Assets, and the other layer comes from Unity’s packaging system AssetBundles. Therefore, we will normalize from these two aspects to understand what Unity’s Assets are.
Addressable Chapter 1: Assets – Unity Asset Reference
https://blog.en.uwa4d.com/2022/02/22/addressable-chapter-1-assets-unity-asset-reference/

  1. Questions about Addressable 2) How to perform the hot update of Addressable 3) How to set the Shader variable of SceneView camera 4) The reason why Activity defaults to SingleTask 5) About the Resources.UnloadUnusedAssets call time is too long Today, we continue to select a number of issues related…

This article is the first chapter of the Addressable series.    What are Assets? Generally speaking, we have two layers of cognition on Assets: one layer comes from Unity's default project directory Assets, and the other layer comes from Unity's packaging system AssetBundles. Therefore, we will normalize from these two…

#

Those topics are easy for your guys to check out the issue you probably rencounter in the future.

next inlet
#

Hi, these addressables are a bit confusing. Hoping someone can help me out with my understanding! I have some questions about this bit of code:

{
    for(int i = 0; i < 10; i++)
    {
        string key = "Prefab";
        //preload to gain access to the handle.Result, so that we can supply the rotation of the source prefab to the instantiated prefab
        var preLoadHandle = Addressables.LoadAssetAsync<GameObject>(key);
        yield return preLoadHandle;
        if(preLoadHandle.Status == AsyncOperationStatus.Failed)
        {
            Addressables.Release(preLoadHandle);
            throw new Exception("Addressable not found");
        }

        var instantiateHandle = Addressables.InstantiateAsync(key, preLoadHandle.Result.transform.position, preLoadHandle.Result.transform.rotation);
        //result should be immediately available
        instantiatedPrefabs[i] = instantiateHandle.Result;
        Addressables.Release(preLoadHandle);
    }
}```
#
  1. Do you see anything wrong with this code? I am using LoadAssetAysnc together with InstantiateAsync, mainly because I need to access the rotation and position values of the underlying prefab asset when instantiating the game object that will be used in the scene.

  2. I believe the ref count should be 2 after the InstantiateAsync call, then 1 after the first Release call. Is that correct?

  3. Does the Release call release the underlying asset bundle, or because the ref count is still at 1, the asset remains in memory?

  4. If my understanding of the ref count is correct, then subsequent LoadAssetAsync calls should not actually load in a new asset bundle, but instead detect that the asset is already loaded and use that for its Result. Is that correct?

  5. All InstantiateAsync calls should use the asset loaded with the first LoadAssetAsync call, right?

  6. Let's ignore that this is a loop. Instead, imagine that the subsequent calls to LoadAssetAsync and InstantiateAsync occur at a later time, but it's always true that at least one instance of Prefab still exist in the scene. These calls will not force a new asset bundle to be loaded into memory, correct?

next inlet
#

Okay, so perhaps I different question then.

If I want to load multiple addressable assets at the same time, what is the best way?

  1. Individual calls to LoadAssetAsync and I track the load operations manually.
  2. Using LoadAssetsAsync
  3. Using CreateGenericGroupOperation

Are 2 and 3 simply convenience features that allow you to track group progress as a whole? Or is there some efficiency advantage to them? I am concerned that those two methods will cause garbage generation due to the list that is returned. I also don't like that the whole operation seems to fail if any one asset fails to be downloaded/found. So I would lean towards 1, but don't know if it is inefficient to use that method.

hot shadow
#

Why when editing prefab quite slow than normal on addressables asset folder?

sudden mesa
#

Is it normal that the GetDownloadStatus().Percent function always returns 0 when trying to load addressables from local folders ?

#

Unity 2021.2.14f with Addressables 1.19.19

#

I wanted to show the download progress but it keeps returns 0 in the yield loop.

mild flax
#

Yes it’s 0 because it is essentially “already downloaded”. Might be quite difficult to show an accurate progress bar - I’m not sure if there’s any other api call for monitoring the progress of eg the decompression for large bundles.

sudden mesa
#

Ok, I see. I'll just show a loading icon then without the actual progress, that'll be enough. Is this information written on the documentation page regarding local content returning 0? I don't remember seeing that. It might be worth mentioning.

charred osprey
#

Hi everybody! My first post, so I hope I'm not breaking any rules etc. by asking this question. I want to load some songs at runtime from a folder on my local drive. ( not inside unity assets folder). Would addressables be the correct way to go about this. I assume asset bundles wouldn't work. I've managed to obtain some data outside of the assets folder by getting URLs via JSON file and managed to get 1 song only via UnityWebRequestMultimedia.GetAudioClip too. The problem with the things I've tried so far have limited me to single files,audio,videos only. As mentioned I'm wanting to include several songs at runtime from outside of unity assets folder. So are addressables the correct way to go about this or is there other options available to me?

wooden moss
#

be aware, last time i checked, you cannot load .mp3 at runtime because of licencing

rich quarry
#

@charred osprey do you mean that you want to be able to load external music into the game

#

you would be using file operations in that case, and would need to convert them into an audio clip

#

looks like this SO question uses WWW to accomplish this:

#

but WWW is fairly old, so perhaps see if there's a way to do it using UnityWebRequest

wooden moss
#

it is pretty much the same with UWR but like i said, you prob won't be able to use .mp3 because licencing (and that's built into unity)

rich quarry
#

the SO also indicates this

wooden moss
#

but maybe the .mp3 licensing ran out since then

rich quarry
#

SO says it works with mp3

wooden moss
#

haven't checked

wooden moss
rich quarry
#

yah I believe you

#

just noting it seems to be working at least as of 2019.3

wooden moss
#

yeah, last time i implemented it was with 2017 or 2018 i think but .ogg is better anyway XD

rich quarry
#

ogg 4 lyfe

#

if you're loading external music tho you may not have a choice 😄

wooden moss
#

and yeah he stated previously that .mp3 doesn't work on windows. but apparently that ran out now. hooray

rich quarry
#

yay

wooden moss
rich quarry
#

haha

#

"This program only supports ogg because f u"

wooden moss
#

not really. because licensing

#

XD

#

good to know

rich quarry
#

what is taking its place?

wooden moss
#

AAC and others

charred osprey
#

@wooden moss Streaming Assets Folder. I'll look into this. I wasn't aware of that option. So .mp3s are legal now i assume. Basically i've made a set of DJ turntables to mix with and the DJs will likely have .mp3 files in their playlist. Getting them to convert their files would likely be problematic because people don't like taking extra steps. 😄

wooden moss
charred osprey
#

that sounds the ideal approach for me. Cheers Mindstyler. I'll look into that and try dig some info about using streaming assets folder instead