#📦┃addressables

1 messages · Page 2 of 1

frigid stag
opaque sandal
#

Well, I have watched these two, but what about build part? about compression and how to arrange addressbles to not have something that not need for my build, which increase my build size?

frigid stag
opaque sandal
#

Addressables build Asset use Asset Bundle too, it 's auto when I build. But some how? The overall content is bigger then the build that not use addressables :>>

#

The one that not use addressable has atlas

#

When I remove atlas, it's the close size

coarse scaffold
#

Hey all - I'm Jeff. I'm the product manager for Addressables. I'll be more active in this channel in the future, particularly with announcements for new features, updates, and learning materials. I may also have some questions for you all from time to time. I unfortunately won't be able to jump in to answer specific questions or help troubleshoot issues -- for those, the best place is still either on the official Addressables forum or in this channel, getting help from other folks in the community.

I'll have some more exciting updates for you very soon, but In case you missed it, we recently published a "best practices" blog for Addressables: https://blog.unity.com/engine-platform/addressables-planning-and-best-practices. Feedback is always very appreciated, whether on the blog post or on the Addressables system & feature set.

opaque sandal
#

I read the blog, but what about webgl? Does Webgl gains advantages of addressables? Any tips? The examples doesnot have webgl too? 🥲

hard gale
#

I built the whole world creation and modding system of traVRsal around addressables. My flow is that users download my free Unity editor plugin, create their worlds, package them locally (one button click in the tooling, the user doesn't need to know anything about addressables) and then uploads them to an s3-compatible server for runtime consumption. If you need to get such a flow going I can give some good pointers. The packaging plugin is also open source. The resource that really helped me most in the beginning are the amazing blog posts by the GameDev Guru: https://thegamedev.guru/unity-addressables

TheGamedev.Guru

Test excerpt addressables

cunning light
#

Hey guys, I'm trying to use addressables to load some ScriptableObjects of mine, and I'm getting this error:

System.Exception: Unable to load asset of type System.Object from location Assets/my_scriptable_object_path.
UnityEngine.ResourceManagement.Util.DelayedActionManager:LateUpdate () (at Library/PackageCache/com.unity.addressables@1.19.19/Runtime/ResourceManager/Util/DelayedActionManager.cs:156)

Any idea what causes this?

cunning light
#

private IEnumerator Co_LoadAssets(object key, Action<AsyncOperationHandle> completionCallback)
{
AsyncOperationHandle<IList<object>> handle;
handle = Addressables.LoadAssetsAsync<object>(key,
(addressable) =>
{
//do something here
});
Debug.Log($"Loading assets for addressables key {key}");
while (!handle.IsDone)
yield return null;
Debug.Log($"Finished loading assets for addressables key {key}");
completionCallback?.Invoke(handle);
}

#

The handle's result is supposedly an System.Object[]

#

But I get a null value, and the error as well.

hoary rampart
cunning light
#

I managed to load one type of ScriptableObject that way

#

Loaded it as an object, used the 'as' keyword to parse it

#

It isn't working for another type of ScriptableObject though

hoary rampart
#

well then make sure the path is correct then

cunning light
#

I'm using a label as the key

#

Which I've made sure is correct

cunning light
#

Worked around this for now, but I think the problem was caused by nested references in ScriptableObjects. One of my SOs takes refs of other SOs, all of which are addressable.

#

Also guys, another doubt: In the addressables build layout's Files section, what do 'sharedAssets' and 'sharedAssets.resS' mean? Can't find any info on these online, or maybe must've missed it.

eternal tundra
#

Got a bit of a confusion going on while building asset bundles. I read that you can load specific assets from a bundle using AssetBundle.LoadAsset. This led me to assume that they would be put all in a big file, that I can upload to my backend, download as a whole then load the specific assets as needed.

In the inspector, I set the assets up as you can see in the "ball" example with the sphere model. However, instead of getting one big basic file, I seem to have gotten one for each asset, as you can see in the projects view screenshot. It is worth noting that I didn't build them into the basic folder, but created it to sort up the unexpected several separate files I ended up with.

This is the script I'm using to build my assetbundles.

using UnityEditor;
using System.IO;

public class CreateAssetBundles
{
    [MenuItem("Assets/Build AssetBundles")]
    static void BuildAllAssetBundles()
    {
        string assetBundleDirectory = "Assets/AssetBundles";
        if (!Directory.Exists(assetBundleDirectory))
        {
            Directory.CreateDirectory(assetBundleDirectory);
        }
        BuildPipeline.BuildAssetBundles(assetBundleDirectory,
                                        BuildAssetBundleOptions.ForceRebuildAssetBundle,
                                        BuildTarget.StandaloneWindows64);
    }
}

Can anyone point me to what I'm missing? Am I supposed to put them all in a folder, and make that folder part of the bundle as well?

vocal wind
#

Got a bit of a confusion going on while building asset bundles. I read that you can load specific assets from a bundle using AssetBundle.LoadAsset. This led me to assume that they would be put all in a big file, that I can upload to my backend, download as a whole then load the specific assets as needed.
this is correct, you can have something like 3-4 models and 10 textures into one .assetbundle file

#

(and then load a specific asset from the bundle)

#

the way i've usually done it is have a prefab and the prefab has multiple things inside (like 4-5 models)

#

then BuildAssetBundle(something.prefab)

#

apparently: BuildAssetBundle has been made obsolete. Please use the new AssetBundle build system introduced in 5.0 and check BuildAssetBundles documentation for details.
yikers

cunning light
#

Hey guys, quick question: If I load a scene using addressables, and then load another scene (LoadSceneMode.Single), is the ref count for the first scene set to 0, and the addressable asset unloaded?

eternal tundra
#

Would the setup vary for addressables, as in I should set them as addressables immediately if that's how I want to use them, or can I get used to this first and then just "convert it" later?

#

I'm sorry for the noob questions, but I do really appreciate the help:) Not my first rodeo in Unity but my work now requires things to be much more dynamic than they've been before

vocal wind
#

The way you wrote seemed legit so the multiple files is a head scratcher to me

eternal tundra
#

Curious about the filetypes too, as they ended up getting "CYLINDER", "BALL", "CUBE", "BOT" and "CAPSULE" as the filetype, which is what I've set as the subname(?). I need to find something that goes over the setup in Unity I suppose, not just the scripting API

#

I can see addressables has an option for "Pack Together", so I should probably just work that out instead. This was good rubberducking

daring stratus
#

Please share your ideas.

I set up addressables, set up a remote group, and I'm trying to start the fresh game without the Internet (so no cache, no remote catalog downloaded, only local catalog with local group assets).

The following error occurs:

  1. I am trying to load asset from local group > 2. Before that addressables trying to load remote catalog and failing > 3. My local assets loading is failed too because first two operations are chained inside addressables! DisableCatalogOnStartup checkbox has no effect too ofc.

At the same time, if I turn on the Internet and download the catalog from the server, everything works fine (even without the internet using cached versions later)

What are my options?

hoary rampart
daring stratus
daring stratus
daring stratus
#

In another words:

How to handle the missing remote catalog?

gaunt kestrel
#

Hey there, I'm doing some Addressable testing. I have a remote bundle that consists of a scene and a material. I am wanting to load the scene on start using this super lightweight script:

using System.Threading.Tasks;
using UnityEngine;
using UnityEngine.AddressableAssets;

public class LoadAssetsFromRemote : MonoBehaviour
{
    [SerializeField] private string _label;
    void Start()
    {
        Get(_label);
    }

    private async Task Get(string label)
    {
        var locations = await Addressables.LoadResourceLocationsAsync(label).Task;
        foreach (var location in locations)
        {       await Addressables.InstantiateAsync(location).Task;
        }
    }
}```
#

As I might expect I get an error: System.InvalidOperationException: This method cannot be used on a streamed scene AssetBundle.. I am just not sure the correct way to load this data.

oak pendant
gaunt kestrel
#

But how do I differentiate scenes from non-scenes in the bundle?

#

Or am I just doing this incorrectly?

oak pendant
#

im not sure if there's any API to ask what the asset type is from the key, was discussed here. https://forum.unity.com/threads/how-to-get-the-asset-type-where-an-addressable-key-points-to.1127489/

I don't think you'd want a generic catch all "load asset" that can load anything whether its a scene or a prefab etc. Loading a scene requires extra parameters like load additive etc anyway, so you probably should know upfront that you're loading a scene and how you want to load it?

hoary rampart
#

^ you should already know what asset you want to load, the bundle will be loaded with it

hexed shell
#

You should also always be awaiting any method that returns a task. You are pretty lucky you're getting any exceptions at all when not doing that

gaunt kestrel
#

That's fair

#

So the only thing I should actually get is the scene and it will grab everything else it's supposed to?

#

Like this?

using System.Threading.Tasks;
using UnityEngine;
using UnityEngine.AddressableAssets;

public class LoadAssetsFromRemote : MonoBehaviour
{
    [SerializeField] private string _label;
    void Start()
    {
        // The only addressable with a label in this group is the scene.
        _ = Get(_label);
    }

    private async Task Get(string label)
    {
        var locations = await Addressables.LoadResourceLocationsAsync(label).Task;

        foreach (var location in locations)
        {
            await Addressables.LoadSceneAsync(location).Task;
        }
    }

}```
#

Hm. Doesn't seem to work.

#

Do I need to load the dependencies first somehow?

#

The scene consists of a prefab object and nothing else, so it might be loading the scene but not the prefab object

#

It's so strange I cannot find an example of someone loading a scene that is hosted remotely via addressables. I can find examples of loading things via addressables, and examples of instantiating objects via addressables

hoary rampart
#

There shouldn't be much difference code wise loading local and remote groups iirc

gaunt kestrel
#

Not getting any errors...the asset just doesn't seem to load.

hoary rampart
#

As long as you've set up the paths correctly anyway

#

Why don't you try loading it without threading?

gaunt kestrel
#

I'll try that.

gaunt kestrel
#

OK, it seems to work if I am looking for the specific addressable by name. So that's a start

hoary rampart
#

That's how you're supposed to load addressables in general

gaunt kestrel
#

OK, so here's a fun question. Let's say I have 10 scenes that are all hosted together, that were added by different people. How can I load one of those scenes by name, since it's not in my local addressables groups?

hoary rampart
gaunt kestrel
#

I feel like I'm missing something. To explain:

I have one "start" scene that is part of the app. There are remote scenes, which each of which have their own content and dependencies, hosted in the remote location. Each of these scenes was uploaded by a different person, and so the bundles all have different (unique) names.

#

So I need some kind of way to tell the app what bundles are available at runtime, and then be able to access them

hoary rampart
#

I dont even know if you can access them if you're not building them to the same catalog

gaunt kestrel
#

Hmmm. That might be an issue

cedar trail
#

I'm trying to load a sceneasset (I can't load scene directly from name unfortunately because this is an editor script) and it's giving me this weird issue. When I try to load as a SceneAsset, it tells me that it's a SceneInstance instead. So I try to load it as a SceneInstance, it tells me as a System.Object. So I try to load it as a System.Object, and it tells me no. I can verify that the key points to the correct asset. How do I fix this?

cedar trail
#

I eventually ended up not using addressables for this.

elfin shoal
#

happy to here

#

I need your help, faced some red errors when i build addressable

#

check this video and let me know how to fix them.

#

It cost me too much time.

brazen moss
#

HI there
is it possible to iterate through an addressables folder to find out its subfolders?

exotic saddle
#

Hi! is there a way to get the size of an addressable asset in memory without loading it?

#

This is for an editor tool, so it doesn't have to work at runtime

lucid mulch
#

is there any way to test predownload packages in unity editor ?

#

i've tried to search on google but there's no answer. it kind of annoying when build application to app and test.

hoary rampart
lucid mulch
#

and a warning Asset bundles built with build target Android may not be compatible with running in the Editor.

#

it look like i have to build to test update catalog mua

hoary rampart
#

Well yeah

#

You need to build them for windows to test on windows

lucid mulch
#

it'll take a lot of time atwhatcost

hoary rampart
#

How big are your assets goddamn

lucid mulch
#

i mean i can test on simple project but i feel it still waste time honestly

hoary rampart
lucid mulch
daring stratus
# daring stratus In another words: How to handle the missing remote catalog?

Everything is much worse than I thought. Any addressable operation is trying to update remote catalog first and does not complete when failing to download it. And there is no way to cancel the operation... The same behaviour in 1.18.19 and 1.21.8.
No completion event fired, task is in waiting for activation status, bool field IsDone is false.
And timeout operation does not work because it is internal operation!

It is terrible!

turbid zephyr
#

Is there any exception thrown? (Even if you don't see any exception in the console, I'd wrap it in a try catch to verify

daring stratus
#

Addressables does not throw exceptions. There is just an error, but it is internal
I made this work only like this ¯_(ツ)_/¯

dusk lodge
#
UnityEngine.AddressableAssets.InvalidKeyException: Exception of type 'UnityEngine.AddressableAssets.InvalidKeyException' was thrown. Could not load Asset with GUID=77c34669b98a6f94492212b129d072b6, Path=Assets/Sample View/LocalizationAssets/Flags/en.png. Asset exists with main Type=UnityEngine.Texture2D, which is not assignable from the requested Type=UnityEngine.Object
UnityEngine.AddressableAssets.Addressables:LoadAssetAsync<UnityEngine.Object> (object)
#

ahem

#

Any idea why that could be thrown?

#

Addressables.LoadAssetAsync<Object>(guid)
I simply do this call

#

oh, it throws this error if asset is not marked as addressable (which was import bug)

cobalt axle
#

Hi, is there any chance to make build without addresables? We try to make DLC and don't wanna include this content to base version

#

there's a "include in build" checkmark, but doesn't work for us

snow stream
#

Well, you could fetch some WebRequests to download the data as assets, then import at Runtime, preprocess them somehow at Start. I can't figure out how to achieve that last part either, sorry...

#

In fact, I find Addressables and Bundles still a very difficult thing to learn and use, in general. They seem designed for web developers in mind, not for Unity average users, neither beginners...

#

Compared with, let say, ScriptableObjects or Custom Inspectors, they're in another league.

cobalt axle
#

Thanks, I understand how to load/unload this assets, we use them locally, not remotely and need to add this content to steam as DLC, it's only 100mb so it's not a big deal, thanks

drowsy holly
#

why is the InstantiateAsync super fast in editor, but very slow in the build?

#

i've disabled CRC and made the bundle compression uncompressed

#

and its a little bit faster now

#

how can i change the build script mode to fastest?

north birch
#

what would be the good ways to access all the assets had been loaded from the remote?

#

store all of them into dictionary and get them by the actual file name? or?

#

also

#

this thing is checked by default, so my builds are always loading the local cache at start

#

it confused the hell out of me for 2 days trying to solve it

#

so I should uncheck all of them?

#

gosh why it has to be this messy

cobalt axle
# cobalt axle Hi, is there any chance to make build without addresables? We try to make DLC an...

Ok, AI helps me to find the answer, so if somebody has a similar problem, there's a answer:

To create Addressables DLC (Downloadable Content), you can follow these general steps:

Organize your content: Determine which assets and resources you want to include in the DLC package. It's a good practice to keep the size of the DLC as small as possible to reduce download time and bandwidth usage.

Create a new Addressables group: In the Addressables window of the Unity Editor, create a new Addressables group for your DLC. You can do this by clicking the "Create Group" button and giving your group a name.

Assign assets to the group: Select the assets and resources you want to include in the DLC, and drag them into the new Addressables group you created in the previous step.

Build the Addressables content: Build the Addressables content by clicking the "Build" button in the Addressables window. This will create the necessary files and metadata required for Addressables to load your content.

Create a new DLC package: Once the Addressables content is built, create a new DLC package. This can be a ZIP file or any other format you prefer. You can use Unity's built-in packaging system or third-party tools to create the package.

Upload the DLC package: Upload the DLC package to your content delivery platform of choice (e.g. Steam, PlayStation Network, Xbox Live, etc.). Make sure to follow the guidelines and requirements of the platform for uploading and distributing DLC.

Load the DLC content: In your game, load the DLC content using the Addressables API. You can use the Addressables APIs to download and load the DLC content on demand, or preload the DLC content at specific points in your game.

Note that the specifics of each step may vary depending on your project and platform requirements. You may also need to handle authentication, encryption, and other security considerations when creating and distributing DLC.

frigid stag
#

How do you prevent duplication of shader whenever you use AssetBundle ? My duplications come from scene materials (local scene) and Asset Bundle materials. There is already a post on that from the Unity Support, but the solution does not make any sense for my use case; Any materials, packaging in scene or in AssetBundle, will use the same set of shaders. (https://support.unity.com/hc/en-us/articles/216536423-Shader-Duplication-with-AssetBundles)

Is redefining, at build time, the shader that are being use in the scene for those in an AssetBundle a possible solution ?

Note: I'm already using a copy of the built-in shaders to prevent duplication between AssetBundle

oak pendant
#

when you say "scene materials (local scene) " do you mean a scene that gets included in the build?

frigid stag
#

It is not necessary as they won't be added copied in other bundle. It could be a better approach to flag them if there is even the smallest possibility that they could be used from an other bundle.

oak pendant
# frigid stag It is not necessary as they won't be added copied in other bundle. It could be a...

hmm, you have to keep your bundles and whats included in the builds as 2 seperate worlds really.

Have a fairly empty scene that comes included in the build and it's job will download/load the asset bundles and then you can load a scene and whatnot from the bundles which can contain what they want.

Not exactly sure what you're including in this scene but if it is just a small scene to get you into game that you pass through it might not be a big deal with some duped assets for it,
they'll only be duped and used in that scene All other assets within the Bundles will reference the shader thats in the bundle. (wouldnt want 4k textures doing this mind you as it'll just bloat the build!).

frigid stag
#

You would remove all scene from the build and use AssetBundle to load a scene ?

oak pendant
#

that would be my general flow yeah, any scenes included in the build will just include all assets it needs in the build as well, so it'll work against using bundles

#

you don't need to manually mark 'sub assets', they should get 'auto included' in the bundle their parent asset is in. 1 effect of auto included assets is that you can't directly access EnvironmentMesh, it'll jsut get loaded via its reference in the prefab. This is probably what you want anyway. If 2 assets in 2 different bundles reference an 'auto included' asset I believe Addressables resolves this automagically to avoid duplication where as using AssetBundles directly doesn't

(I'm only speaking from experience with AssetBundles not Addressables, but it should be the same?)

hoary rampart
burnt marsh
#

Oh sorry posted in wrong

unique citrus
#

Hellosy, I am new to using Addressables and am struggling with getting my assets to show in the build.

#

I build my groups from the group manager and it tells me everything goes fine but some assets(primarily images) do not load.

#

If I select "Use Asset Database" everything works but "Use Existing Build" returns blank spaces for all images

hoary rampart
unique citrus
#

@hoary rampartI have not tampered with the paths but the other group full of scriptable objects loads up correctly but the group with images doesn't seem to load, they have the same path(local).

#

I am loading the images into a static dictionary using LoadAssetsAsync<TObject>(IEnumerable, Action<TObject>, Addressables.MergeMode)

hoary rampart
unique citrus
#

Its ok now. I was using that method wrong. I am glad ChatGPT is smarter than me.

plucky plank
#

Hey there! Is it possible to load assets from two or more different locations (url1, url2, url3, etc )? Or all the assets should be in the same location (only url1)?

hoary rampart
plucky plank
#

Yeah, I saw this post yesterday but I found it was a very complicated solution from 2019, maybe after some updates it has a easier way to do it. Thanks anyway 🙂

#

For now I'm creating multiple groups and changing it load path

elfin shoal
#

hello volunteers!

#

I am getting an error : Exception: Attempting to use an invalid operation handle

#

please let me know how to fix it.

#

after downgrade version of addressable package, i am getting this error.

novel aurora
elfin shoal
#

@novel aurora thank you very much

cedar trail
#

How do I find a resource by a tag?

grim copper
#

So Im having some issues with addressables atm, where it seems like if I load some asset with the same ResourceLocation, but one using its base class and one using the class itself causes some issues and doesnt actually Release the reference when I decide to release it later on

#

Ill send an example in a bit

#

looks something like this atm

#

ignore the errors under the top 3

#

in terms of the code, its a bit convoluted but the gist of it for the above screenshot is:

  • Load the addressable (As the type)
  • Load the same addressable address, but from its base type
  • Unload the above addressable
  • Unload the first one (This is where the errors occurs)
#

Also, loading/unloading these separately causes no issues, its only when I do these 2 operations async does it show that exception

cedar trail
novel aurora
drowsy holly
#

hey, im having a sequence container with enemies that im instantiating via addressables, the enemies are also marked as addressables, altought they aren't loaded, they just sit in that Sequence Container which is being loaded asynchronuesly. How can i release the memory that the enemy takes when the enemies dies? I guess enemy.ReleaseInstance() when he dies won't work, since I didint load him by addressables?

clear obsidian
#

Hey everyone, I'm trying to implement addressibles to reduce loading time. There's a bit of a problem. When I debug all elements of a list - they seem to be correct, the names are debugging the right way.
But when I instantiate - null ref exception is thrown.

Everything works correctly in the editor though.

clear obsidian
#

Got it, I didn't include the dependencies in the addressables bundle. I read somewhere that they are automatically included.

hazy trench
#

I'm using Unity Addressables in my project, but I'm encountering an issue where Addressables are not working in a smaller player build compared to other builds. Specifically, some Addressable assets are missing or not working as expected in the smaller build. I've checked the build settings and made sure that all the necessary Addressable assets are included in the build, but the issue persists. Could this be related to the computer used to create the build, or are there other potential causes? What troubleshooting steps can I take to resolve this issue? Are there any known solutions or workarounds for this issue? Any advice or guidance would be greatly appreciated.(Smaller means 1 MB)

hazy trench
#

Problematic build size which addressables is not working as expected is smaller than other builds

frigid stag
#

Is the build 1MB ?

hazy trench
#

I mean normal build is 98 mb but problematic one is 97 mb

hazy trench
steady quiver
#

Hello everyone, I'm having this issue.
Put one initial scene in build, put the first scenes before login in the default group, put a separate group for shared asset and another for the selection scenes (theme and game)
So in the first scene the classes (scriptables in another group) are loaded in the class manager
after login, the themeselection scene is loaded perfectly, but when i load game selection, 3 things happen:
1 - classes are unloaded
2 - the prefab that is the element that handles the selection lose its component script references
3 - the assest of shared group are also lost
That was my 5th attempt to solve just checking forums and also requested support from friends, but no replies neither results until now.
Anyone got an idea?

young iris
#

hello everyone, is there a way to add an argument here to build each time into a new child folder to separate and better organize?

true willow
# young iris hello everyone, is there a way to add an argument here to build each time into a...

You could create a static class with a public static method, then use the build time profile variable syntax to use it in the build path. Here is an example that does this by creating a folder with a unix timestamp:

public static class AddressablesHelper
{
  public static string Timestamp {
  {
    get { return $"{DateTimeOffset.UtcNow.ToUnixTimeSeconds()}"; }
  }
}

Then in your Remote.BuildPath in the profile you could access it at build time like this ServerData/[AddressablesHelper.Timestamp].
In this example I used a timestamp, but it could be modified to return almost anything you want in your build path.

young iris
#

I tried, on my image you can see the name of my class + method

MyFolderNameAdressableScript.AdressableBuildFolderName

what is written in the profile that I use

ServerData/[BuildTarget]/[MyFolderNameAdressableScript.AdressableBuildFolderName]/

the whole class

using System;

public static class MyFolderNameAdressableScript
{
    public static string AdressableBuildFolderName()
    {
        return DateTime.Now.ToString("yyyyMMdd_HHmmss");
    }
}

result of the operation on the image

#

I must have missed something

#

and I replaced $() with []

#

I have to use exactly the same syntax as your script?

true willow
#

Let me take a look at what you have. In the past I have seen it do similar things when it can't find it.

#

It looks like it needs to be a property and not a method for it to be called. (at least I could not get it to call the method).

#

But changing your script to the following worked for me:

using System;

public static class MyFolderNameAdressableScript
{
    public static string AdressableBuildFolderName
    {
        get
        {
            return DateTime.Now.ToString("yyyyMMdd_HHmmss");
        }
    }
}
young iris
#

and for me too it's always a question of syntax, thank you very much!! 🙏

true willow
#

No problem, glad I was able to help. 🙂

quartz hamlet
#

anyone know if there is a way to unload/release an addressable by its guid?

void lion
elfin shoal
#

"no translation found for " Localization in Unity Editor
How can I fix it?

quartz hamlet
hollow geyser
#

i have been testing the memory usage with addressables and i noticed that when i create an empty scene with no objects and profile it, i still see large textures that are still in the memory. why is that?

void lion
rigid shadow
#

Can someone help me regarding reference errors when building the project (specifically, building the addressables)? I can launch the game fine, but when building, I get the error:

Assets\Scripts\CodeGen\CerasAotFormattersGenerated.cs(6,7): error CS0246: The type or namespace name 'CerasAotFormatterGenerator' could not be found (are you missing a using directive or an assembly reference?)

This references the Ceras binary serializer which has it's own asmdef. However, I only have one asmdef at the root of my scripts folder, and it's correctly referencing the Ceras asmdef.

How can I troubleshoot this?

hoary rampart
brazen moss
#

Hi there
does anyone know a way to load multiple AssetReferences at the same time?

deft vortex
#

Hello, I have a folders with 20k .json files with levels for each language that I want to move to the cloud with addressables, so that levels in different languages can be downloaded. What would the best way to go about this? I dont think referencing each level in every language as an addressable would be the way to go..
can you just bundle a folder and then read the file in the folder by filename?

marble bay
#

Hey, how come when I load my object in the editor the texture comes out pink?

hoary rampart
marble bay
#

I am getting this error in my webgl build but I don't even know if I should post this in Webgl or addressables channels:

#

System.Exception: Dependency Exception ---> UnityEngine.ResourceManagement.Exceptions.OperationException: GroupOperation failed because one of its dependencies failed ---> UnityEngine.ResourceManagement.Exceptions.RemoteProviderException: RemoteProviderException : Unable to load asset bundle from

#

I am using Unity services to store my addressables...

tiny blaze
#

@marble bay Possibly not a super helpful answer, but pink shaders mean that your renderer (built-in, urp, hdrp, custom) isn't being served what it needs from your material. Either the material is missing or it isn't producing output in a format that the renderer can use. Different renderers have different requirements for their shaders, which is why a shader made for URP looks pink in HDRP, for example: HDRP has channels for specular, metallicity, etc which makes it incompatible with URP. Just some examples of what could be the cause if not related to addressables.

marble bay
#

This is what it looks like when I download the assetbundle. I did read that if the addressable is built for webgl then materials will look pink if loaded in editor?

tiny blaze
tiny blaze
marble bay
#

Ok, what I am trying to do now is test my build in webgl but it seems there is an error when loading from the Unity Game Services my addressable...see the error log i posted above...

oak sequoia
#

Hi everyone,
I have a very basic question about addressables in build:

I have one scriptable object, SO, which is referenced in Scene A and in Scene B. Both scenes are addressables.
When I load Scene A and and then Scene B, will both load the object as copies or refer to the same object ?
For eg,
SO has a public int num = 5
I load scene A, and set num = 10. Now when I load Scene B, will SO have num = 5 or 10 ?

mild flax
deft vortex
#

Hello, if I only want to be able to download asset bundles from a server is it worth using addressables or just use asset bundles without addressables?

astral hare
#

so i am using addressables for a WebGL react controlled web application, i was able to get addressables working on a windows build but i am getting these errors on the webgl build, this is in a custom webserver not the index that is built from unity, i have no clue why this is happening or how to fix it

#

i have googled for hours to fix this an i can't find anything

slate timber
#

Hi, I tried to load an asset bundle in IOS and I got this error: NotSupportedException: ./External/il2cpp/builds/libil2cpp/icalls/mscorlib/system/appdomain.cpp(168) : Unsupported internal call for IL2CPP: AppDomain:LoadAssemblyRaw - “this icall is not supported by il2cpp” . Asset bundles dont work in IOS?

novel aurora
slate timber
novel aurora
#

And are you sure your scripting backend is set to il2cpp?

#

And are you sure the pathOfTheAB is correct?

alpine peak
#

I'm reading about Build Profiles, it looks like your only choice is to point them to a completely different folder of assets, code and everything. For my Demo build, I just want to exclude all the levels in the game except one, I don't want an entirely separate code base. What's the best approach?

barren ginkgo
alpine peak
brazen moss
#

Hi there
does anyone know if there's a way to load addressables in background on WebGL?
Anything I've tried before seems to block the main thread...

haughty forum
astral hare
#

webgl can't use multi-threading,

hoary rampart
young cipher
#

If I wanted to load an asset bundle that is on my hard drive but not included in my build how would I set that up?

Would I still use Custom Load Path? Or would that not work because the root of the path is the projects Data folder?

#

I ask because I'm trying to add extra content that wont be packaged with the project (So basically DLC)

#

Another question I have is how do you check if your asset bundle is in a specified location or not?

clever egret
#

is anyone having issues using the addressables i'm using unity 2022.2.1f1 and i can't build or create new groups it keeps breaking

indigo wharf
clever egret
#

I think it's a bug but i try to rename a group i t break i get this error

not sure how to fix it

#

so i downgraded and issues is fixed it's a bug in the new version of addressables

young cipher
#

Anyone else had this happen after a domain reload. I have to close Unity and reopen to fix it every time.

#

Build Path and Load Path should have the directories loaded in, but they don't and this causes all builds to fail.

#

As far as I can tell it only happens with custom Build and Load Paths

naive harness
#

just a quick question, when using stuff like Addressables.InstantiateAsync there is no need to hold onto the async handle to later release it right

#

it will simply get released once that gameobject is destroyed?

young cipher
#

So anyone know if there is a way to check if an addressable asset exists in a directory. I asked earlier, but got no response. I'm trying to see if the addressable I created exists in a file location or not so I can tell my game not to try and load it if that is possible.

hoary rampart
young cipher
#

OK Now I'm confused. Then how do you check if LoadAssetAsync should or should not be called? It seems LoadAssetAsync is expecting the AssetBundle to be in a specified location.

#

I was looking for a way to have it so if the asset/asset bundle didn't exist on local storage it would ignore that and move on.

hoary rampart
young cipher
#

I have even tried LoadResourceLocationsAsync and that just returns the same thing even if I delete the file from the specified location

hoary rampart
young cipher
#

Delete the bundle only

#

I'm new to the addressable system and so I don't understand how building adds things to the catalog, and how I'm supposed to tell if assets are external assets that will come in that are not to be included at runtime.

hoary rampart
young cipher
hoary rampart
#

Delete the bundle that is

young cipher
#

I'm not trying to delete the bundle I want my code to check if it exists and then if it doesn't tell the game not to access the content (Or is that not how it works)

#

I'm basically trying to do DLC

hoary rampart
young cipher
#

Well I mean I only did that as a test. Like what if I haven't downloaded it yet. Like if I have DLC on Steam I need to test if the Asset Bundle isn't on the hard drive

hoary rampart
#

Then you can do what it says in the thread

#

So test it by having a build with no bundles and another build with bundles

young cipher
#

I must have misunderstood what was being said in the thread, because I was under the assumption the keys were the asset references I would set up in my project and not file locations. Or am I still not getting it right?

hoary rampart
#

Yes, they're not file locations, they're keys

#

The bundles themselves are still located somewhere though, and that's what's the solution in the thread checks

#

You can't just delete the bundle manually to check though, what you should do is remove the addressables you want to test and make a new addressable build

#

So it builds new bundles and a new catalog

clever egret
#

please help! Has anyone gotten Azure CDN working with Unity if so can you show me how i really need this

clever egret
#

so in addressables 1.21.2.9 there is not documentation for using other cdn is there a reason why

young cipher
#

@hoary rampart Yeah I gave up on trying to load the asset bundle through the addressable system, Loading it the normal way works for me though. And since it is loaded the way I normally load assets I can check and see if the file directory already exists and just tell my code if it can be loaded or not.

#

It sucks because the Addressable system seems like it should just handle all of that for me, but it seems it doesn't. I tried getting it to work with the example you showed me, but it just didn't work.

#

On the bright side I can still use the addressable system to pack my asset bundles though. So I can still use it for that.

clever egret
#

Guess the addressable system need a bit more work and docs need to be updated

dense totem
#

Hey guys. I am really new to addressables (and as an artist probably lack basic coding knowledge in general to understand parts of it) Therefore I'd like to recap and ask a question.

What exactly is the purpose of addressable groups?
I read through https://blog.unity.com/engine-platform/addressables-planning-and-best-practices and also watched "Packaging content with Addressable Assets | Open Projects Devlog" (The Unity Devlog about how they used addressables in the ChopChop game on Youtube) as well as the code monkey YT video about them.

I know I am not smart so before I assume something to be a fact and work with that, I'd like to recap and be confirmed that my assumption is correct or false.

So. From what I read and heard are Addressable Groups some sort of containers / folders that I can put all kinds of "things" (Gameobjects, Audio Clips, SO, Materials, etc.) into so that they get bundled when the game is built. This are AssetBundles, which I also lack deeper knowledge about but according to some research they seem to be "Chunks of Data" which get downloaded together. So if I would make a change in one of this Bundles and publish a new Game-Patch, the User will only download this particular Assetbundle and not the whole game du to some other kind of black magic? (assumption)

This Addressable Group-Bundles should now follow a form of logic depending on various factors. For example an empty gameobject called TimeManager with a TimeScript should be put into a Gamelogic group so it can be always loaded and therefore always progress ingame time.
Then there are things like inventories, ambient music or UI-Windows (which dont neccesserily need to be loaded all the time, but need to be accessible most of the time. So they can be loaded into the RAM when the game and/or player chooses them to be loaded (for example when they want to check the character stats or a combat track plays as soon as a fight breaks out)

dense totem
#

Another way to use this groups is to bundle Scenes / Environment which seems to be similar to how unity handled Scenes in the past (Assumption?) but now in the format of Addressables so you dont have two loading systems. Here also comes up the question I mentioned in the beginning:
If I have a Scene (Beach) and another Scene (Forest) then I can put both scene files into an Addressable group "Locations". What happens if both of them Contain a Prefab called Rock_001.prefab ? Will they share it or will each bundle contain their own version of it which would increase the project size? Would I have to create another Group containing the rock so that each scene does no longer contain the rock but instead sees it as an dependency?
(This last part is very confusing so I am not sure if I understood the entire system right or not and would appreciate if someone could shed light on it)

#

PS: I am very very sorry for the long wall of text. I did not expect it to become so long

mild flax
# dense totem Another way to use this groups is to bundle Scenes / Environment which seems to ...

Apologies in advance - I'm just going to give a very lazy answer. Yes, by default Rock_001.prefab would be in both bundles. This is a problem from a memory perspective but it doesn't "not work". There is a built-in script for detecting duplicate assets - the script automatically puts the duplicates inside a separate shared bundle. In general though it's up to you to manage this in whatever way is appropriate for your project. When set up correctly and you request eg Beach.bundle, shared_rocks.bundle and other dependencies will also be downloaded.

Some important points:

  • No code gets included in a bundle - only a reference to the code file in your project. That means the code must exist in your project that is loading the bundles with the same name and namespace as when the bundle was published. Bundles will also relatedly not store any version of the code.
  • SOs don't work like how most people would want them to. If you have a ScriptableObject in your main project called e.g. Colors and then a bundle that references Colors - once the bundle is downloaded and instantiated, the Colors it refers to will not be the same object that your main project referenecs.
  • Regarding the 'black magic' it's actually quite simple how it works when you understand it but it's quite opaque. Everything within a single bundle will be downloaded. There is a setting to 'pack separately' where for each marked asset they will become their own bundle. Finding the right combination will be specific to your requirements but say you update the Beach group, you can republish that group and players would download everything in that latest version of bundle. Great if you update a whole level - not so great if you change the colour of the sand reguarly.
dense totem
# mild flax Apologies in advance - I'm just going to give a very lazy answer. Yes, by defaul...

First of all: Thank you for your time to read my wall of text and write a "lazy" answer. It already helps me understand a few things.

The script that turns duplicates into a shared bundle sounds like a nice safety save to prevent inflating the project but also sounds like something that shouldn't be overused. In case of the example I assume it would be best to create a group for nature assets or something similar so both scenes can just reference it. That way I also have additional groups but at least know for sure where the rocks are, what is in them and if I update a single rock: Know that only the nature bundle gets updated and not a "shared bundle with who knows how many random things in it"

About your SO-Color example: Isn't that what happens if the SO is a dependency? If 2 Bundles reference Colors as a dependency each of them gets their own version stored in the bundle which causes them to talk with different SO's in the game. But if I make the SO's addressable and put them into a separate bundle, then other bundles don't create their own version of Colors but instead just point towards the SO-Bundle? At least thats what I understood from the ChopChop example at https://youtu.be/XIHINtB2e1U?t=261

Games have tons of assets, and they need to be packaged and loaded in a smart way to provide a smooth experience for the players. In this fourth devlog we explore how we did it in "Chop Chop" using the power of Addressable Assets.

🔗 Get the demo on Github (Unity 2020 LTS and later): https://github.com/UnityTechnologies/open-project-1/tree/devlo...

▶ Play video
distant yarrow
#

Any way to avoid/mitigate spikes when loading addressables? I'm seeing huge spikes from DElayedActionMAnager.LateUpdate when it actually instantiates my gameobjects in the scene.
It's hard to profile where the issue comes from as it's bundled in the profiler, and in deep profile it gets muddied by any string or file operation.
I've tried to minimize the actions on Awake, but I've got 20+ms spikes from something ultimately only loading 3 objects :/

dense flare
#

watching that video, I dont entirely understand the issue that addressables are trying to solve and i dont really understand how much of a gain you get from this, could someone explain it to me? it sounds like a potentially interesting system that i might want to use for my game

dense totem
# dense flare watching that video, I dont entirely understand the issue that addressables are ...

Addressable is not trying to solve the issue at 4:21. The Issue at 4:21 happens because you use addressable so you need to figure out a solution.

Addressables itself is a system which lets you control which parts of your game gets loaded into RAM because by default if you have a script that references 20 objects, then all 20 objects get loaded into RAM as soon as the script is loaded, no matter if that 20 objects are actually in the scene or not. For a better showcase I recommend to watch: https://www.youtube.com/watch?v=C6i_JiRoIfk

dense flare
#

thanks

#

anyways yeah i watched the whole of that first video

dense totem
# dense flare thanks

No problem. The video from code monkey shows rather well the performance impact that Addressables might have depending on how good / bad your coding is^^

dense flare
#

yeah thank you for the video

astral hare
#

So I am still having this problem that Webgl does not want to load the seetings.json file, which causes a bunch of errors, i have included the errors and the code used to load the scene, i do not initialize with Addressables.IntializeAsync() i can send the profile settings if that helps to

#

i have built for windows and this does work, so it is only a webgl Issue

#

i am on unity 2021.3.19f, addressables 1.21.9

#

I have spent so many hours on this, and this is so fustrating that i have no clue why this is happeneing

astral hare
#

So i figured if i use the build and run, it works, but running it on a custom sever using npm start in cmd it does not work

hoary stratus
# astral hare So i figured if i use the build and run, it works, but running it on a custom se...

well well well, That is most definitely webgl shinanigans. My guess is that on your server JSON file is not reachable. Reason is, webgl have very specific rules with files reading.
A) Put your JSON file in streaming assets folder. And setup your server to let users load JSON files inside permisions.
B) Load your JSON file with webrequest. This is actually what unity recommends instead of using streaming assets.
As resources loading..... is hit or miss on webgl 😄

astral hare
hoary stratus
#

so it is streaming assets approach. If you create streaming assets folder in your assets I do believe manually doing that is not needed. Unless you have non standart location of your streaming assets. 😄

#

as his streaming assets folder was in; /WebGl/Stands/StreamingAssets which is not default location 🙂

#

anyways, I feel sorry for you to work on webgl anyways 😄

astral hare
#

it is automatically added to the streaming assets

hoary stratus
#

yes streaming assets folder by default is on same place as Index.html

marble bay
#

Wait, I cant see Animator from an asset bundle thats loaded?

dense totem
#

I am very new to Addressables so. Has anybody an idea what would be the best approach to delay scene loading?

What I currently know:

  • AssetReference.LoadSceneAsync loads an AssetReference like a scene.
  • LoadSceneAsync has a parameter called LoadSceneMode.Additive to load multiple different scenes into each other.
  • LoadSceneAsync has a parameter called activateOnLoad (which I assume, can be set to false to load it into RAM but not actually show the asset in the scene / create the scene? I don't really know if thats the case since I am unable to find more about it in the docs? But maybe thats just me being stupid)

Assumption: I can load multiple scenes in the background via LoadSceneMode.Additive and activateOnLoad = false

My problem: How do I keep track of what scenes are currently loading so that I can call Activate() on each of them as soon as they are all ready?

#

The reason I ask is simple: At the beginning of the game I currently load 2 scenes: 1 with the environment, 1 with the character + game logic. Gamelogic is always done faster loading so my character spawns in and falls into the void since the environment isn't done loading yet :x

clever egret
#

so for those who is like me and want something different with the addressable I mad a tool that allows you to achieve what I want where you can share addressable between unity project or different workstations in the office. i will post a link with the resource for those who want to take advantage of the tool.

Note: it uses azure store to store the bundles so you will need to edit the Azue data scriptable object with your own credential

north flax
#

if i instantiate a gameobject using a certain address/key, is there a way to access the key that the object is instantiated with or will i have to cache that?

north flax
#

I see, ty

young cipher
#

So I'm not sure where to post this, but it is sort of related since addressables hasa relationship with asset bundles.

I have this issue where my sprite mask tints the sprite pink and hides the sprites even though I tell it not too.

#

This only happens with prefabs in the asset bundle

#

This is what it looks like normally when the sprite is not in an asset bundle.

#

I'm not entirely sure if it is the sprite mask or a render setting, but this kind of confuses me because no other settings are changed between the build and when adding the content in the asset bundle.

#

Well I can tell it isn't the sprite that is causing the issue after doing more testing. It seems the Sprite Mask is the issue for some odd reason.

#

But I don't understand why it works if assets are in the build but not if they are in an asset bundle.

#

😕

young cipher
#

I figured it out I think. By changing the render order of a Render Feature I have set up for another effect in my game it doesn't show the pink tint.

#

The only issue is the sprite is still masked out for some reason

young cipher
#

Welp I think I see what is going on. Apparently the render inside mask option doesn't get passed into my asset bundle on some of my sprites.

Anyone know why that is?

#

It seems the settings are correct the thing that is wrong is the settings are not being reflected in game

#

Clearly it shows Visable Inside Mask during play mode

#

But for some reason the sprite isn't visible inside the mask

#

But if I check it against a sprite that isn't in an asset bundle everything is correct

#

Never mind I thought it was fixed but disabling the sprite and only leaving the mask enabled shows this.

#

Now I'm even more confused

eager rapids
#

how can i load an asset instantly when using addressables?

#

i guess it is not possible since google showed no useful results about it

plain terrace
#

so, synchronously

#

i imagine that it's not very practical, since Addressables are designed to work seamlessly no matter where the assets come from

#

blocking the entire game until you finish downloading the asset from a server would be pretty catastrophic

#

i guess that's what you're looking for

eager rapids
#

i am not even using cloud

#

i guess i wasn't supposed to use adressables

unkempt tartan
#

hi all, I'm wondering if you've encountered an issue like what I just encountered. I gave my playtesters a demo build a few weeks ago and nothing has changed since. This morning I tried running the same build and it couldn't load my Menu Screen (which is an addressable). It got stuck at "is loading" in the hierarchy. However, I haven't changed anything and all the addressables Content Packing & Loading are set to "Local" which, as I understand it, should be packed as part of the build itself and not separately or fetched from somewhere. Has anyone encountered this recently?

#

surprisingly, running it in Unity Editor also yields the same issue with no errors in the console

hoary stratus
# unkempt tartan hi all, I'm wondering if you've encountered an issue like what I just encountere...

When you say on editor you have same behavior that does not work, what is your addressables play mode settings:

Beause it is Use Asset Database(fastest), then it pretty much means it have nothing to do with addressables. And you have made mistake somewhere in error. and it worked before because it might have used old addressables cache or something.

My suggestions:

  1. create debug logs manually, and check where it stucks, so you would know what code does not run
  2. use addressables debugger to confirm if things even trie to be loaded
  3. Clear addressables cache and rebuild. (building game does not automaticly rebuild addressables, unless you apply some settings somewhere.)
  4. if behavior is still weird, try removing Library folder and start editor again to rebuild your assets, maybe something got corrupted.

This is all I can say if there is no errors.

unkempt tartan
hoary stratus
#

Just to confirm, using Fasters pretty much you don't really load from addressables packages, you dont even need to built it to see changes. So that is big suggestion that problem is with code or editor it self.

dense totem
#

If I make a folder (NPC_Animals) addressable. will all files inside it also be addressable?

#

And if so, is there a reason/situation where one would want to make a file also addressable even tho its folder is already addressable?

young iris
#

Hello everyone

Is there a solution to load assets from a catalog on server which has a different name for the .hash file than the one indicated in setting.json file of a compiled webgl version?

for example
in the aa folder of the compiled build
there is a setting.json file, inside there is
"m_InternalId":"https://server-exemple/catalog_2023.04.13.19.32.27.hash"
and on the server we find for example
catalog_2023.04.13.20.32.27.hash

I know that once compiled, to update you have to do an update previous build, but isn't there a solution to be able to build new without worrying about that?

stone swan
#

I'm having a really strange issues with addressable assets rendering incorrectly on the right eye when loaded on an oculus quest, if anyone has seen anything similar I'd really appreciate any help! Video and forum link in #🥽┃virtual-reality

rugged tangle
#

Hi! We generate quite a few assets in our build pipeline (we split larger scenes - easier to work with, into smaller scenes - better for loading; we generate the world map screenshots, we generate meshes build time, etc) and have a lot of these generated assets in a Assets/Generated folder (ignored in git). And we tiptoe around pulling this into addressables with a custom script.

Is there a better way to handle generated content into addressables? One of the main pain-points is that when Two engineers generate the content (obviously it's not pushed to vsc as this is a pure build-time stuff) it'll get a random GUID, so we can't really share addressables asset groups either.

sullen jasper
#

Sup, I get an error about addressables when building the game : error CS1061: 'AssetReference' does not contain a definition for 'editorAsset'
However the game works just fine in the editor. Any ideas ?

lusty yoke
#

you're probably trying to build something that includes stuff from the unity editor namespace. other than that no idea about addressables.

plain terrace
#

It does sound that way.

sullen jasper
#

Well the property is in the AssetReferenceGameObject type

#

Alright I'm super braindead. I just had to .LoadAssetAsync() and then i could do the same thing that I did with editorAsset.

novel furnace
#

Is there anyone know why AsyncOperationHandle.PercentComplete is always 0?

mild flax
novel furnace
#

How can I fix it?

mild flax
# novel furnace How can I fix it?

It's not really broken if that's the case. The recommended way to check if an asset is already cached is to use GetDownloadSizeAsync() - if it's 0 then it means it's cached (dumb, I know).

novel furnace
#

What I'm trying to do is using loadHandle = Addressables.LoadSceneAsync() to load scene and use loadHandle.PercentComplete to get the progress.

#

loadHandle.GetDownloadStatus().Percent is also 0

#

The first debug always returns 0, but the second one is 1. Does that mean the progress jumped from 0 to 1?

trim bane
novel furnace
#

It takes 4 frames to load, does that means instantly? Or it should have some progress in these 4 frames?

novel furnace
little viper
#

Is there any drawbacks of having object that is marked as addressable placed on scene?

naive harness
#

is there a way to prevent this error
Exception of type 'UnityEngine.AddressableAssets.InvalidKeyException' was thrown. No Asset found with for Key=SFX. Key exists as multiple Types=Audio.ClipBucket, UnityEngine.TextAsset, which is not assignable from the requested Type=UnityEngine.AudioClip

this is happening when i am loading assets via a label like this
_audioClipsLoadHandle = Addressables.LoadAssetsAsync<AudioClip>(_sfxAssetLabel.labelString, x => _audioClips[x.name] = x);
since there will not always be clips there but for how this logic works having now clips is still a valid state

naive harness
#

feels pretty hacky and verbose but ended up just making a function like this to avoid the issue

private AsyncOperationHandle<IList<T>> LoadAssets<T>(string key, Action<T> onAssetLoaded) where T : Object {
    if (!Addressables.ResourceLocators.Any(x => x.Locate(key, typeof(T), out _))) return default;
    return Addressables.LoadAssetsAsync(key, onAssetLoaded);
}

then before awaiting the returned async op i check of its valid

viral orchid
#

So I would like to know how far can I take addressables? If I have an entire city, with buildings made up of stories made up of rooms made up of furniture made up of tables, chairs and sofas. Can I have one specific chair addressable sit on my server, and it gets referenced up the entire chain? Or will I have duplicates of that chair either way?

#

Or in other words, I have an Eiffel Tower, an Empire State Building, and a Titanic, and they all contain a million references to the same "nut" and "bolt" object. Can I or should I deal with this with addressables?

opal folio
#

Hello, has anyone ever run into this when trying to build addressables?

*** Tundra build success (0.24 seconds), 238 items updated, 1314 evaluated
Stopping BuildPlayerGenerator after running for 300 seconds
Failure running BuildPlayerGenerator
Arguments:
"C:/Program Files/Unity/Hub/Editor/2021.3.16f1/Editor/Data/Tools/BuildPlayerDataGenerator/BuildPlayerDataGenerator.exe" @"C:/dev/projects/[Redacted]/Library/BuildPlayerData/response.rsp"
stdout:
stderr:

Failure running BuildPlayerGenerator
Arguments:
"C:/Program Files/Unity/Hub/Editor/2021.3.16f1/Editor/Data/Tools/BuildPlayerDataGenerator/BuildPlayerDataGenerator.exe" @"C:/dev/projects/[Redacted]/Library/BuildPlayerData/response.rsp"
stdout:
stderr:

Error parsing types of editor assemblies.
UnityEngine.StackTraceUtility:ExtractStackTrace ()
UnityEditor.Build.Player.PlayerBuildInterface:CompilePlayerScriptsNative (UnityEditor.Build.Player.ScriptCompilationSettings,string,bool)
<more Unity native strack trace>```
slate timber
#

One question, what does happen with the size of the games with asset bundles? For example, Imagine I have a game of size 100 Mb, which has one scene. if I decide to make that scene an asset bundle and then load it in the game at runtime, how does the size change? Before loading the asset bundle, the game + the asset bundle of scene are significantly less than 100 mb? And after loading it, the game is 100 Mb? Or the total size stays more or less the same?

hoary rampart
rugged tangle
slate timber
hoary rampart
slate timber
sturdy rampart
#

So I've got my addressables set to both load and build to CCD / remotely, but I noticed in my player build report that they're still getting added which is ballooning my APK file size

hoary rampart
sturdy rampart
pine kestrel
#

so I am really new and I was looking through the history here; however I wonder if someone can shed some light if I am ok or moving into a bad direction.

I am making an MMO with photon as the multiplayer system and was planning for most of the scenes and many items to be loaded as addressables hosted on my servers.

I am wondering now if I would run into issues having 1000 players at a time loading many addressables into a server?

Or with proper setup this should be okay?

hoary rampart
pine kestrel
dense totem
#

I am fairly new to addressables as well and am wondering if I use it correctly so here is the situtation:
I have a script which manages my Quickbar. Depending whether you hit 1-8 it shall "highlight" that slot by replacing the QuickbarBG sprite with a QuickbarBGActive sprite. My thought was to load both sprites via addressables. As soon as the quickbar appears, I want to load the sprites and unload them when the quickbar is disabled (which will be rarely the case, only in cutscenes or maybe a screenshot mode if I implement one.) Do you think addressables is even needed for such a situation and if yes is this code working as I plan it? (I have high self doubts so I am never sure if I use things correctly)

    [SerializeField] private Sprite iconDeactive;
    [SerializeField] private AssetReference iconDeactiveAssetref;
    [SerializeField] private AsyncOperationHandle<AssetReferenceTexture2D> iconDeactiveHandle;
    private void OnEnable()
    {
        AsyncOperationHandle<Sprite> texHandle = Addressables.LoadAssetAsync<Sprite>(iconDeactiveAssetref);
        texHandle.Completed += (obj) =>
        {
            if (texHandle.Status == AsyncOperationStatus.Succeeded)
            {
                iconDeactive = texHandle.Result;
            }
            else
            {
                Debug.Log($"Failed to load obj[{obj}]");
            }
        };

    }
    private void OnDisable()
    {
        Addressables.Release(iconDeactiveHandle);
    }
inner pine
#

Is there a way to exclude addressables from a server build?

iron mason
#

any free place to host an addressable, would something like photon pun work?

iron mason
#

ty

storm otter
#

Disable Catalog Update on Startup speeds up load time by 10 seconds

plain terrace
#

Is there a distinction between making a folder Addressable and manually making all of the things in it Addressable?

safe crystal
#

are adressables a solution to the 4gb limit in scenes like the asset bundles?

nimble saffron
#

Hi All
I'm wondering how people deal with the duplication of sub-assets in their projects?
Specifically around scriptable objects?
I'm a fan of the scriptable object architecture, especially events and singleton managers as scriptable objects
BUT if I have a addressable GO that references some scriptable objects I get new instances of those objects so my events/data isnt linked

storm otter
#

Roycon's duplicate assets problem

frigid stag
pine kestrel
#

I have setup my game to import a weapon from my server, lets say for example it's a sword.

Is there a way to align that sword to the avatars hand by presetting where it will be placed without actually having the asset at build time?

hoary rampart
dense totem
plain terrace
#

That's roughly what I worked out. The only thing I was left curious about was whether I could somehow reference the entire folder.

#

But I guess the folder itself is not an asset, in any sense: it's just a thing that can have lots of assets in it

#

The motivation here was to be able to load an entire directory of assets. It'd be nice to be able to use an asset reference, so that there are no magic strings

dense totem
#

You could use labels instead?

plain terrace
#

That's what I wound up doing there. Still felt weird to have the magic string, but I guess it's just one string

dense totem
#

hm yeah I know what you mean

plain terrace
#

The weirder motivation here was to try and retrieve the GUIDs of the assets (which I could only figure out how to do by using an asset reference), but I think that was just one hell of an XY problem

dense totem
#

wait

#

what prevents you from using an entire folder?

plain terrace
#

I couldn't pick it in asset reference field.

dense totem
#

I am not 100% if it works, but I was able to drag and drop an Addressables folder into a AssetReference field of one of my SO

plain terrace
#

hmm, let me go look again

dense totem
#

I can also not pick it in the drop down but drag and drop works

#

not sure if it actually loads everything inside but i was able to drop it in there

plain terrace
#

ah, but what would type would you punch in when trying to load the asset?

dense totem
plain terrace
#

i get a null when trying to load an Object

#

and an InvalidKeyException

dense totem
#

hmm yeah thats an issue

#

we probably found a bug there

plain terrace
#

"Asset exists with main Type=UnityEditor.DefaultAsset, which is not assignable from the requested Type=UnityEngine.Object"

#

amusingly, if I request such a thing

#

"Asset exists with main Type=UnityEditor.DefaultAsset, which is not assignable from the requested Type=UnityEditor.DefaultAsset"

#

it's probably just a consequence of allowing any Object to get thrown in there

dense totem
#

^^

#

What is inside this folders?

#

In most cases I can think of you just need the gameobject since stuff like sprites and materials would get also loaded as a dependency so I am curious whats inside there

#

At least thats what my extremely limited knowledge can think about

plain terrace
#

A bunch of ScriptableObject assets

#

again, big ol' XY problem...the original scheme was that I wanted a way to get the GUID of the assets, so that I could write those to a file to save the game (and then later find them while loading the game)

#

They represent save points

#

I wound up just putting some editor-only code in that grabs their GUID from the AssetDatabase when validating them

dense totem
#

oh @plain terrace ? Since we are at it right now: Do you know if / how one can get the path of an AssetReference? I want to work with asset References in the inspector but convert them to their string paths in code to save as json

plain terrace
#

note that I started using addressables approximately yesterday, so that may not be the best way :p

#

it resolves the reference into a resource location

#

my understanding is that loading an addressable is a two step process

#

1: get the resource location
2: get the resource

#

both of these can be non-trivial operations, so they're both async

#

Debug.Log(UnityEngine.AddressableAssets.Addressables.LoadResourceLocationsAsync(reference).WaitForCompletion()[0]);

#

this produces a path for me

#

I think you want the PrimaryKey property of the result

dense totem
#

This part seems interesting

#

So I think I need the InternalId since thats the path I need to load the sprite?

dense totem
plain terrace
#

I've had trouble grokking the system.

#

I'm not really in a position to need it yet (and I probably won't wind up using it for my current project)

naive harness
#

anyone know off hand how to set the active addressable profile via editor script?

glacial blaze
#

Anyone here ever run into the issue of 'Resources/unity_builtin_extra' getting into multiple addressable groups?
This is happening to me, and by consequence, creating scene dependencies to multiple addressable bundles as each of them got a different asset from there.
So loading that scene triggers downloads of those other Remote groups.

I'm trying to figure out a way to get 'unity_builtin_extra' into some embedded group, so they don't need to be downloaded.
Any advice is welcome.

chilly lava
#

HI. Once you have finished creating the Addressables, what is the best method in your opinion to search for the files in order to save and upload them elsewhere?

This is my code:

public async static void SaveAddressableScene()
{
    string rootPath = $"ServerData/{SceneManager.GetActiveScene().name}/{Application.unityVersion}";
    string[] dirs = Directory.GetDirectories(rootPath, "*", SearchOption.AllDirectories);
    //Searching in Platform folders
    foreach (var folder in dirs)
    {
        string dirPath = folder;
        DirectoryInfo dir = new DirectoryInfo(dirPath);

        FileInfo[] info = dir.GetFiles("*.*");
        foreach (FileInfo f in info)
        {
            var statusRequest =  await UploadFileAsBytes(File.ReadAllBytes(f.ToString()));

        }
    }
}
candid pelican
#

Hi guys, Im trying to fetch addressables built from projectA to project B. So far, im able to fetch prefabs w/ all animations etc by following the official documentation. Now, I need to fetch scriptable objects which contains asset references to the prefabs. I don't have scriptable object scripts in my Project B and I don't want to duplicate code in both projects. My main reason for putting addressables in a scriptable object is to dynamically introduce new assets in the game app. Im down to completely redesign this architecture. Any leads on this? Thanks.

brave rock
#

Hey everyone. I did a bunch of digging but can't seem to find a solution. When loading addressables on a webgl build the entire game freezes up until all addressables have been downloaded. I tried switching some of the settings around like the CRC check and caching but I have confirmed it's waiting until all files have been downloaded no matter what settings I use. Is there no way to make the download not affect the game?

undone hound
#

<param name="key">The key of the assets to load dependencies for.</param>

What's this key and where do I get it?

#

This is for DownloadDependenciesAsync()

candid pelican
hoary rampart
undone hound
#

Cheers

brave rock
candid pelican
#

what function are u using to download ur addressables ?

next cairn
#

When building addressables, is it necessary to wait around for the shader variants to compile? Because it's clocked the 10 minute mark and I need it to be done so I can test the system I've been working on.
And what kind of computer specs would determine the speed of the process?

brave rock
candid pelican
#

Can u share ur code because addressables load call is non blocking

brave rock
# candid pelican Can u share ur code because addressables load call is non blocking

`public string address;
private event Completion completionEvents;
private Delegate onDestroy;

void Load() {
handle = Addressables.LoadAssetAsync<TObject>(address);
handle.Destroyed += OnDestroy;
if (handle.IsDone) {
OnComplete(handle);
} else {
handle.Completed += OnComplete;
}
}

private void OnComplete(AsyncOperationHandle<TObject> operation) {
if (operation.Status == AsyncOperationStatus.Succeeded) {
// run completion delegates
completionEvents(operation.Result);
} else {
Debug.LogError($"Asset for {address} failed to load.");
}
}

public void OnDestroy(AsyncOperationHandle operation) {
onDestroy?.Invoke();
}`

Had to strip some production stuff from it for obvious reasons

candid pelican
#

lgtm

#

no clue why its blocking

#

have u tried LoadAssetAsync in a coroutine

brave rock
daring stratus
#

Any ideas please?
The Local group A has the asset A1. The Asset A1 has an AssetReference to the asset B1 which is in the B remote group. When I load A1 asset while the group B is not in a cache, there is always a chained operation to download the group B.
Any chance to prohibit this behavior on a settings level? Or the only solution is replace the AssetReference to a string key inside a script?

hoary rampart
cinder saffron
#

Seems like addressables does not save values of variables wrapped in #if UNITY_SERVER defines.
Am I right about this or am I missing something?
Does anyone have any recommendations to get around or solve this issue?

ebon coral
#

Is it possible to have different behaviors for cross platform builds with addressables? For example having a webgl build load assets from a web server while a windows build loads assets locally?

dense flare
#

So if you package the addressables as not the unity server, it wont include those variables in the code at all

cinder saffron
dense flare
#

Yeah thats what I was saying
I think unity serializes based on client build or game build not server

cinder saffron
dense flare
#

Well idk then
A workaround could just be taking the if tags off the variable so its always included

#

Orr, did you try the [SerializeField] attribute just in case?

cinder saffron
dense flare
#

I mean I'm not an expert so don't trust my answers as 100% truths (or even 70% truths), just throwing suggestions out there

cinder saffron
#

I'm not 😛

#

your suggestions were all fine though. Removing the tags would work but I don't like having all those variables exposed to the client

remote sapphire
#

It's not really an Addressables question but rather an Asset Bundles Question:

We are working on a game for Android using Unity 2022.2 and URP. The game is going to have over 1GB so we are going to use Asset Bundles with PAD (Play asset delivery). Each map has three light scenarios and we have a system for dynamically loading the lightmaps (The lightmaps and render informations are stored and then applied at runtime).

Everything works well in the editor but the problems appear when I try the build on Android and using asset bundles, the problem is that the shader variant gets stripped (we are using mostly the built-in Lit shader). Also, kepp all variants is not an option as the build size and time will be tremendous.

Is there any way to make Unity keep the variants needed for the lightmaps? Even some workarounds will be appreciated.

lilac linden
#

how do I avoid instancing an object that is already being instanced?

#

any way to check that with the handle?

daring stratus
#

Hi everyone. Any ideas how to recreate an .apk file if I "Clear build cache" without building bundles again with a "New build"? I was expecting the "Update a Previous Build" will do it, but it only recreates remote bundles and local monoscripts and shaders, so I can't build because I missing all other local group bundles

daring stratus
lilac linden
#

I am using IsValid() && !isDone

#

by default operation handle, I mean one set to default, like "opHandle = default", or when it's just created.

tough iris
#

I'm new to addressables, and I'm completely lost. Is it possible to stream in an AssetBundle containing a scene from outside of the project files and then load that scene during runtime? I keep getting the runtime error "this method cannot be used on a streamed scene AssetBundle"

#

For context, the error appears when using the .LoadAsset function

tough iris
#

Here's my code block:
` public string scenePath;
public string sceneName = "scene";
void Start()
{
var assetBundle = AssetBundle.LoadFromFile(scenePath);

    if (assetBundle == null)
    {
        Debug.Log("Failed to load scene!");
        return;
    }

    // Load the scene asset from the AssetBundle
    SceneAsset sceneAsset = assetBundle.LoadAsset<SceneAsset>(sceneName);

    if (sceneAsset == null)
    {
        Debug.LogError("Failed to load scene asset: " + sceneName);
        return;
    }

    // Unload the AssetBundle to free up memory
    assetBundle.Unload(false);
    SceneManager.LoadScene(sceneAsset.name);
}`
lilac linden
#

I have some prefabs that are instanced at runtime and use data from a scriptable object. What is the proper way to set the addressables so the scriptable object is shared between all objects?

#

My understanding is that those scriptable objects are being instanced as clones when the prefab is instanced, so they are not pointing to the same data

#

Only the prefabs are set as addressables, so they are handling the dependencies as default

#

For it to work as shared memory, should I set the scriptable objects as addressables and load in advance, or load them into the scene by serialization? Would any of those options make the instantiation point to the shared data?

mild flax
# lilac linden My understanding is that those scriptable objects are being instanced as clones ...

This is correct. The only way is to resolve the instances yourself. Multiple ways to do this but one way is to serialize a unique id into the ScriptableObject itself. If you only have a couple you could do it in a more simple compare-by-name approach. Then eg when you instantiate an addressable you can replace the asset with your global equivalent or whatever solution you prefer.
If you serialize a uid just watch out for the fact that assets can be duplicated outside of Unity so even if you create an editor script to duplicate one, that won't catch some edge cases.

lilac linden
#

Hmm... That kind of breaks the point of using scriptable objects in first place, so I might just move to other solutions instead

#

Thanks

dense totem
#

Important question: windows crashed on playmode and wiped my scene.

I build my addressables before and if I start playmode again after the windows crash they are still somewhat intact.

Question: Can I somehow convert the built addressables back to a scene?

barren ginkgo
#

Hey 👋 Does anyone happen to know how I can link an Object to an AnalyzeResult so double clicking it pings the object in project view?

#

I thought it was not possible but "Bundle Layout Preview" seems to have the functionality.

daring stratus
mild flax
lilac hatch
#

is there any people using photon fusion ? i've a problem how to run function StartGame when i load scene from addressables

hexed shell
pure shale
#

I wanted to use sprite atlases with addressables but it does not load the sprite atlas marked as addressable. Because atlasRequested event in SpriteAtlasManager class is not invoked. I even found a thread on Unity forum about this and it seems it is a Unity bug. I wonder if there is a way around this.

#

Here is the thread I mentioned:

dreamy trout
viral orchid
#

I am building a "platform" type of game. Which means I create a basic scene, and the users can have their own content on their cell/subworld. At first, for the prototype, users can't edit on their own. I create the subworlds (or rather you have to use Unity to do it). So I wanted to do this with assetbundles and addressables. Can I create a separate "game" project which only contains the game mechanics, and a separate "content" project that contains the actual content of the subworlds? Perhaps one project per sub world?

#

I'm trying to understand how I can structure my project (also in git repositories).

#

Common functionality that all subworlds have and which the game implements would be shared as an SDK.

viral orchid
#

So far I learned that you need direct references to your AssetReferences in the same project. So, technically, loading assets from another project is not possible?

hoary rampart
lilac linden
#

For some reason, addressables is not loading detail meshes on my terrain. Everything else loads, except detail meshes. I have the prefabs, material, meshes and shaders in the bundle, but it's simply not loading them (the texture details are loading fine)

#

Is there a catch for loading those things?

#

For reference, the terrain is loaded with the scene, and not as an isolated asset.

#

the mesh details are small things like flowers, weed, mushrooms and branches

viral orchid
# hoary rampart It's possible if you load the addressable by key instead of using assetreference...

How would I be able to test this locally? I was trying to follow this: https://docs.unity3d.com/Packages/com.unity.addressables@1.4/manual/AddressableAssetsHostingServices.html

I tried to set a common build path between the two projects.
If project A is D:/Repositories/game-core and project B is D:/Repositories/game-content; for local testing I wanted to set the Build Path to D:/game-addressables/

The load path is set to http://192.168.0.129:59637

#

I want to test it at first with a simple cube prefab.

#

I tried to load the asset with the path, but this doesn't work.

#

I'm probably making many rookie mistakes at the same time. If anybody could help me out here that would be great.

#

The content is sitting here:

viral orchid
#

I now put the content on an AWS S3 bucket, but still no luck.

viral orchid
#

Why does THIS work.

#

But THIS doesn't?

#

First of all: WHY do I have to tell the Addressables system the url and build target, although I created a profile?

#

Second: if I have to do that at runtime, how can I properly tell it the url and build target?

granite tendon
#

Recently I've been looking into ScriptableObjects as a method of architecting a project. The benefits being that scriptable objects can replace singletons, can support highly decoupled code, can be setup for event channels or even shared variables that systems can access globally. However, I've run into an interaction with this sort of architecture and Addressables that I'm sure others have also experienced or are aware of. I've made a public repo here that is the simplest possible demonstration I can come up with:

https://github.com/njelly/addressables-scriptableobjects-test

I generally understand this as having to do with the way scriptable objects are serialized. When the SO is referenced by a prefab that is referenced directly by a scene object, the prefab and its instances all reference the same SO object in memory. However the SO loaded with the Addressable AssetReference is a completely new instance. This means if I have a ScriptableObject with a UnityEvent that, for example, is raised when a prefab spawns, that event will only work on a build if the prefab is directly referenced by an object in the scene (not an AssetReference). Am I understanding that correctly? This leads to extremely different behavior in a build vs. the editor and I wasted way too much time figuring this out. sadok

GitHub

addressables-scriptableobjects-test. Contribute to njelly/addressables-scriptableobjects-test development by creating an account on GitHub.

viral orchid
#

What could be the reason that after loading and instantiating of an addressable prefab the shaders are not shown correctly?
The shader seems to be correctly applied to the material, but it's invisible or magenta.

When I now select the same shader from the dropdown again, it shows up.

Please note that I am using a separate project to create my Addressables. In the separate project it looks fine. It also worked one hour ago.

#

Suddenly, it doesn't work anymore.

viral orchid
viral orchid
#

I created a new Renderer Asset as per this thread: https://answers.unity.com/questions/1888124/shader-not-loading-on-addressable.html Now at least they all turn magenta. But the thing is the shaders are correctly included in the bundle.

#

It doesn't even work if I include a custom shader!

viral orchid
#

It's a WEBGL issue!

#

If I change the platform to StandaloneWindows64, it works.

candid pelican
#

@viral orchid yes webgl,ios,android etc platform's materials are not supported on pc version of editor. However, on mac u can download and use addressables for ios.

viral orchid
#

AND yesterday it worked. In both the Editor and WebGL build.

candid pelican
#

hmmm no idea about it.

viral orchid
#

Weird.

uneven dagger
#

Hey, I am using addressables and its trying to build a script in Editor folder so: Assets\Scripts\Core\Serializable\Editor\SerializableDictionaryPropertyDrawer.cs(5,7): error CS0246: The type or namespace name 'UnityEditorInternal' could not be found (are you missing a using directive or an assembly reference?)
The script folder is not marked as addressable.
But I use SerializableDictionary class but I dont have any reference to I dont have any references to SerializableDictionaryPropertyDrawer itself.
What should I do?

radiant cove
#

Hello everyone. I have a question for build Addressables with URP Shaders. When I build Addressables with both "New Build/Default Build Script" and "Update a Previous Build", some Asset Groups which not changed contents are created as new Assetbundle with different hash. Some Unity Forum threads says it related Shader files. So I tried group up custom shader files which I've created, and tested build. Then, It's result was Assetbundle's hashs are not changed. However, after a few days "New build" regenerated another Assetbundle hash for the unchanged group. Does anyone know how this phenomenon occurs and How I can fix it?

glacial blaze
#

Hey! Sometimes the** Analyze Tool** can be a bit misleading, so I wanted to share a little trick to help spotting dependencies between Asset Groups. In my case, loading the embedded Main Menu scene was triggering the download of a remote group, which was undesirable. So found that by right-clicking the scene and selecting "Export as Package" would pop a window that lists all of the scene dependencies (way more precisely than the Addressables Analyze Tool).
This helped me a couple materials that were causing the dependency and I could resolve the issue by moving the materials and their textures to an embedded group.

viral orchid
#

Success in my Addressables journey. I have now several separate Unity Projects that are solely for creating content and generating Addressables. My 'main' project knows nothing about the content, it just loads Addressables from a server. Which means that for each project I end up with an individual ServerData folder and an individual catalog. How would I now go about cross referencing these catalogs and assets?

dusky kernel
tough iris
dusky kernel
# lilac linden For it to work as shared memory, should I set the scriptable objects as addressa...

Consider data D is shared between A and B.

if data D itself is not addressable, A and B will have copies loaded of D when loaded, i.e. memory will be wasted as there are 2 instances of same data.
if data D is marked as addressable and is referenced by A and B, loading either A and B will recursively load 'data D' as it is part of its dependency.
There is no need to explicitly load 'data D' before hand as loading either will take care of it, same goes for unloading, it will be preserved until the last one unloads, i.e. when A and B both unloads.

lilac linden
#

when in the same bundle, they were being created as clones of the original, but in a separete bundle, they reference properly

dusky kernel
tough iris
dusky kernel
tight sinew
#

i ran into one issue when making 2d unity games

#

each time i add something new (code)

#

unity crashed

#

and when i finished the game for some reason it included random info

#

which included my desktops info

#

folder and such

tough iris
viral orchid
#

Is there a way to define a custom placeholder like [BuildTarget]? I would like to define [ProjectId] and put the actual project id somewhere else.

dusky kernel
viral orchid
#

I have three catalogs from three projects. Each project contains an info.unity scene. I was hoping I could load the catalogs and then load the 3 info scenes. Turns out it loads 1 scene 3 times?

#

How could I do that?

#

Perhaps in other words, how can I specifically load an asset from a specific catalog?

slate timber
#

I have 3 projects, A, B and C. I am using the localization package for translations in all the 3 projects. I have created a asset bundle of the scene of B and same for C. I want to load B and C from A. I can load the scenes, but the translations dont work. How can I achieve this? Do you know where can I an example to do this?

viral orchid
viral orchid
#

What I've been wondering... how many catalogs can I load before it becomes a problem?

dusky kernel
next cairn
#

So I'm trying to update some remote addressables. After I build them, I’m supposed to swap out this existing folder in cloud storage for the new identically named version on my machine. But I’ve ran into a strange problem.
In the existing folder on the server, there are heaps of .bundle files lining up with the assets I have included. But in the folder of the same name on my machine, there are only these four files. I built and updated the script, but it’s still the case. I haven’t performed a full rebuild, but last time I did that it took about an hour because of the ridiculous number of assets, so I don’t want to do that unless I have to.
What is the problem here? I’m pretty new to using addressables this way, and this task was handed over to me from another developer who’s working greatly reduced hours due to paternity leave (and is also in a different timezone so contacting him is a huge pain).
Thanks!

chilly lava
#

I am using visualscripting imported via addressable on a webgl app. I'm having "AOT code not generated" errors on many nodes. Is there a better way to solve these problems than to also import the graphs into the project where the addressable is loaded? Thank you

lilac hatch
#

how to do real simulation download from remote in editor ?

#

i've do any ways to do it but when i'm do in build it always return error or failed

fair belfry
#

I everyone, I have a issue where I have 6 prefab in my addressable group and they are spawning at the start of the game. Right now, its working fine in the editor but when I build and run, it look like the addressable doesn't spawn in the build version. I checked and when I generate a log, it understand what I have inside the addressable and my setting are set to add the group correctly to the build but nothing work. its the first time I'm using addressable so maybe I'm missing something?

keen elm
#

Hi, how i can get Directory LocationJsonDir from my asset bundle?
getting by file name is not suitable because I need to move the entire directory to another location

keen elm
#

hello?

dusky kernel
jovial basalt
#

hi, im new with addressables and I couldn't find the answer for question: is there a way to change the default addressable name and/or path for an asset when it is marked as addressable? I would like to alter it to match my convention for referenced assets

undone hound
#

When making a prefab an addressable, that I don't want in the build, do I have to go through and mark all the meshes/ textures/ materials/ etc as addressables too?

hoary rampart
#

Be careful of using those dependencies elsewhere though or you might end up with duplicates in memory

undone hound
#

Great thanks

#

Everything is self contained in this project, some things are used between prefabs.. but all of them are going in addressables

hoary rampart
jovial basalt
hoary rampart
jovial basalt
#

That's a shame that there isn't some interface that could allow it in a similiar way that assetpostproccesors do

#

Thanks anyway

short solar
#

I'm trying to understand how addressables handle multi-platform.
On the doc it says:
"Multiple platform support: the build system separates content built by platform and resolves the correct path at runtime."
So how does that work at runtime? Do I simply ask to get the "Bunny" asset and it gives me the right asset based on the platform I'm currently using? Different asset per platform?

short solar
#

from what I have been reading, what I have described above would be a "variant" system and it is not handled by the addressable system. Is that correct?

short solar
#

after further reading, I'm thinking that it could be handled by using labels as described in this doc, under "Asset addresses"
https://docs.unity3d.com/Packages/com.unity.addressables@1.21/manual/AddressableAssetsOverview.html

if you have variants of an asset, you could assign the same address to all the variants and use labels to distinguish between the variants:

Asset 1: address: "plate_armor_rusty", label: "hd"
Asset 2: address: "plate_armor_rusty", label: "sd"

Then for loading:

you could specify the address, "plate_armor_rusty", and the label, "hd", as keys and intersection as the merge mode to load "Asset 1".

So hd and sd label would be used for PC and Mobile respectively.

dusky kernel
lethal lion
#

Is it possible to use a URL I get from a server to request/cache an assetbundle?
the aim is to update different users to different assetbundles,
while still giving them the option to correct/change new features, and if the user is in an offline state always use the last cached version.

an example would be to load different scenes according to the assetbundle, some people will load the movie1 scene while some will load the movie2 scene on start.

torn rivet
#

This is more Editor related than runtime related, how can i get the current scene's Address?

#

ok i managed to do it by just making the scene's address be the Scene's asset name. so i can just do this

            var sceneName = SceneManager.GetActiveScene().name;
            var address = sceneName + ".unity";```
doesnt really sound like a good solid solution tho lol
cold goblet
#

According Addressables documentation page: "If you want to get the address of an asset that you load with an AssetReference or label, you can first load the asset's locations, as described in Loading Assets by Location. You can then use the IResourceLocation instance to both access the PrimaryKey value and to load the asset."

I can store IResouceLoaction's to load resources later. But IResourceLocation don't have info about data of the resource. You can have data about resource after you loaded the resource into memory.

I can't find solution where I can get Type of an Gameobject resource, using

Addressables.LoadResourceLocationsAsync(label,typeof(GameObject))

without loading the resource.

I want to map types with locations into dictionary in order to load and instantiate them when I need, using some method like

_uiService.Get<XView>();//inherited from View

Is it possible to get type from resource without loading. Because in order to load resource into memory he should know about the gameobject components, i guess...

undone hound
# hoary rampart Nope, dependencies are handled automatically

I'm not understanding why my addressables build is so small (33kb). I'm expecting it to be over 1GB.

I have scriptable objects and prefabs marked as addressables.
The prefabs are using meshes / textures/ etc that are not marked as addressables.

hoary rampart
undone hound
frosty ocean
#

Hi. Addressables is not a feature/package newly released in Unity v2022.1 right? I'm asking because I'm about to take the tutorial course https://learn.unity.com/course/get-started-with-addressables and I can't change the version to anything below 2022.1. I was trying to stay in the LTS 2021.3 family

hoary rampart
median sundial
#

For some reason I can't make use of Addressables.ClearDependencyCacheAsync<bool>(key);. I simply put it inside var clearOp and expecting .Complete to appear but it didn't. So the only function that I can make use is Addressables.ClearDependencyCacheAsync(key) which is void type but It seems not useful to me because I don't know if it's successfully cleared or not. Then I read on the internet that I can make use of Caching.ClearAllCachedVersion to clear it but it's not working. The result returns true in android build but actually it doesn't clear anything. Just in case there's something weird in my script so here it is:

IEnumerator DoClearCacheLevel()
        {
            var isCacheCleared = Caching.ClearAllCachedVersions(_LEVEL + _contentSO.levelId);

            float timeOut = 10f;
            float timePassed = 0f;
            while (!isCacheCleared && timePassed < timeOut)
            {
                yield return new WaitForEndOfFrame();
                timePassed += Time.deltaTime;
            }

            Debug.Log($"Is cache {_LEVEL + _contentSO.levelId} cleared? {isCacheCleared}");

            if (isCacheCleared)
            {
                OnClearCachedLevelSucceed?.Invoke();
            }
            else
            {
                OnClearCachedLevelFailed?.Invoke();
            }

            _deleteBtn.interactable = true;
        }
frosty ocean
slate timber
#

I'm not able to find ComponentReference in the newest Addressable package for some reason

#

Is there a new way to reference Components in Addressable?

cloud aurora
#

I am going through the addressables overview article, and there is a line that says
"For example, if you want to ship your game with remote content but you want that content to be local during development, you can create a profile where the remote paths point to the streaming assets."

#

What is streaming assets in this context?

#

That is the image they give for context

cloud aurora
#

Ah yeah the StreamingAssets folder

#

Isn't very clear from their wording there lol

cloud aurora
#
        //[Obsolete("We have added Async to the name of all asynchronous methods (UnityUpgradable) -> LoadSceneAsync(*)", true)]
        [Obsolete]        
        public static AsyncOperationHandle<SceneInstance> LoadScene(object key, LoadSceneMode loadMode = LoadSceneMode.Single, bool activateOnLoad = true, int priority = 100)
        {
            return LoadSceneAsync(key, loadMode, activateOnLoad, priority);
        }
#

Really...

#

So there is no none async scene loading through Addressable System?

#

How is AddressablesImpl implemented? Posts have said addressables just calls the SceneManager, so I just need to know how it resolves the AssetReference to scene name/build id

#

I am assuming it is somewhere in Addressables, but this no xml comments in Visual Studio is killing me and making it impossible to figure stuff out.

#

And DescriptorProvider has no comments at all in the script anyways -.-

#

Is Addressables even production ready?

cloud aurora
#

Well the way would seem is to either load the asset in, get the name, and then unload it(which is a waist).
Or get AssetReference.editorAsset, but that is null and I have no clue why...

#

Well editorAsset references UnityEditor for AssetDatabase so is Editor only(which seems like a huge code smell with how this is setup), still makes me wonder how they are getting the information in AddressablesImpl which I can't decompile.

cloud aurora
#

And now editorAsset is working \(-.-)/, but still not what I need.

cloud aurora
#

Well it seems AddressablesImpl is using the ResourceManager to load scenes, and I am assuming however that all works is only Async(why Addressables.LoadScene is deprecated). So not gonna worry about that.

viral orchid
#

I am confused by the Addressables Report window. It claims I can save 111GB of build size. Yet my bundles are much smaller than that.

jagged anvil
#

hello,
I'm using AssetReference in Unity's Addressables system to achieve deferred(lazy?) loading. Is it possible to retrieve a list of AssetReferences for the relevant objects using the Addressables.LoadAssetsAsync method?

viral orchid
#

I'm creating addressables for WebGL, but the UniversalRenderPipeline/Lit shader is never included. When I iterate over the materials after loading the Addressable, the name of the shader is "Hidden/InternalErrorShader". How come? And how can I change this?

viral orchid
#

I tried including a copy of the shader as Addressable, but again, all I get is "Hidden/InternalErrorShader". In the Editor, in Playmode, I have to select the material and reapply the shader manually and then everything shows up.

median sundial
#

so previously I load an asset using Addressables.LoadAsync<GameObject>("Level_Anime") and it was just fine. but then I changed it to Addressables.LoadAsync<AssetBundle>("Level_Anime") and it gives me UnityEngine.AddressableAssets.InvalidKeyException. is it become different when it's AssetBundle? I changed to AssetBundle because when I want to clear the cache using Addressables.ClearDependencyCacheAsync unity said the asset bundle is being used so my guess is I have to unload the asset bundle before I can clear it

astral hornet
#

hi, is there any way to change where the monoscript bundle is loaded from?

astral hornet
#

nevermind im just editing the catalog in the build script

serene sphinx
#

It looks like a lot of questions are being asked but not many answers.

#

I'm also having some trouble with monoscripts. Something about reference already being loaded. I have a project, with built addressable 1 and built addressable 2. They were built at different times. Think of them as dlc. I cannot load both at the same time. Something about the monoscripts bundle already being loaded.

#

When I say load, I mean I cannot instantiate both because of that error.

#

this is my error. The AssetBundle 'Assets\mods\Santa\Schaken-Mods®2_monoscripts_3441bfb1c7ddb6303a37d317e52ae63f.bundle' can't be loaded because another AssetBundle with the same files is already loaded.

serene sphinx
#

Both dlc do infact use the same script structure and such. Would I have to resort to unloading asset A handle and loading in asset B handle?

median sundial
#

I was just trying to delete a specific cache using my script like this

var loadResourceLocOp = Addressables.LoadResourceLocationsAsync("LevelAnimeGroup");

                while (!loadResourceLocOp.IsDone)
                {
                    yield return new WaitForEndOfFrame();
                }

                if (loadResourceLocOp.Status == AsyncOperationStatus.Succeeded)
                {
                    IList<IResourceLocation> resourceLocations = loadResourceLocOp.Result;
                    foreach (var location in resourceLocations)
                    {
                        Addressables.Release(location);
                    }
                    Debug.Log($"Unloaded asset bundles of group");
                }
                else if (loadResourceLocOp.Status == AsyncOperationStatus.Failed)
                {
                    Debug.LogError($"Failed to get resource locations of group");
                }

                Addressables.Release(loadResourceLocOp);

                Addressables.ClearDependencyCacheAsync("LevelAnimeGroup");

No errors, no warnings, everything seems to worked but then I restarted the app and surprisingly it's still there 😂. Is it unity bug? Or is there any workaround to clean cache in a correct way?

serene sphinx
#

Welp, I fixed my own issue. My workaround for the monoscripts issue I encountered was to simply destroy and release the asset, and load another of the same structure.

sick frost
#

[ASK: ASSET BUNDLE]
I make my Scene into an asset bundle, but it is missing mesh, material, etc. Why the dependencies are not included automatically? How to tackle this issue?

teal mortar
serene sphinx
# teal mortar my setup is slightly different but i think you can get around this if you're doi...

So I would be able to load all at once? Right now, I've resorted to loading only one at a time. Destroy and release that one and load the next. I'm making a VTuber avatar app so I really only need one at a time I guess. But I would like to make camera borders and such for it. I would want to load those at the same time. I think you are right. I did tests with just image addressables and they would all load perfect. Anything with a monoscripts bundle, I couldn't load all of them at once. Thanks for at least chiming in. I'm knee deep in addressables. I've got real dlc content working thru our mod website.

teal mortar
# serene sphinx So I would be able to load all at once? Right now, I've resorted to loading only...

this is something i'm still investigating on my own project, but it seems to work OK from what i've tried - mine is set up as a single unity project with a script that turns groups on and off and runs the addressables build several times, so you end up with multiple separate sets of bundles and catalogs, then the game can load all of those together, and i hit the same issue with loading the monoscript bundle until i set the custom naming differently for each build

serene sphinx
#

Thank you so much

#

@teal mortar you're a genius

teal mortar
#

hope it works! i just joined here and saw the exact thing i'm working on first thing as i opened this channel lol

median sundial
#

so I have a scene that have a game object that might be updated in the future. in my case I have to put that game object under the parent of an object(let's say plugin A object). why didn't I just instantiated using addresables? the simple answer is it's because it will become weird so I must put in under the plugin object. so I want to ask is this setup correct? I grouped the scene and the respective object together. and maybe this is a dumb question but do I just need to load the scene or load the asset first?

mystic pasture
#

Working: AsyncOperationHandle<TextAsset> handle = Addressables.LoadAssetAsync<TextAsset>("WeaponRegistry");

Not working: AsyncOperationHandle<IList<IResourceLocation>> handle = Addressables.LoadResourceLocationsAsync("WeaponRegistry", Addressables.MergeMode.None, typeof(TextAsset));

I'm trying to catch when the resource doesn't exist by checking the count of handle.Result but it's always 0

#

Here's my code

public static AsyncOperationHandle<T> LoadAssetAsync<T>(string key)
        {
            Debug.Log(key);

            AsyncOperationHandle<IList<IResourceLocation>> handle = Addressables.LoadResourceLocationsAsync(key, Addressables.MergeMode.None, typeof(T));
            handle.WaitForCompletion();

            return handle.Result.Count == 0
                ? throw new InvalidKeyException($"No asset of type {typeof(T)} found with key {key}.")
                : Addressables.LoadAssetAsync<T>(handle.Result.First());
        }
jaunty turret
#

Hey, there!

Materials are being unlinked when read from bundle file.

How to fix this?

GameObject lPrefab = assetBundle.LoadAsset<GameObject>(name);

GameObject lGameObject = GameObject.Instantiate(lPrefab, GameManager.m_MainCamera.transform.position + GameManager.m_MainCamera.transform.forward 5, Quaternion.identity);
            
potent mantle
#

Hey,
Quick question.
This is my scene/object layout

  1. Parent Scene (Addressable)
    • GameObjectA (Addressable)

If I destroy parent scene, will the child addressable be destroyed and their asset unloaded (or ref count decreased) correctly? Or do I need to unload each addressable individually myself?

serene sphinx
mystic pasture
#

Hm every time I build, the calculation of dependencies takes forever

#

any clue why, and how I can improve this?

teal mortar
serene sphinx
viral orchid
#

I have a similar issue with shaders, they just disappear.

last sky
#

Hey guys, I'm using InstantiateAsync to fill a game object pool. However, I'd like the instantiated objects to start inactive (to avoid processing all the OnEnable callbacks).
One solution is to disable the prefabs themselves, but I'm wondering if there's a better alternative. Before I switched to addressables, I used to just disable and reenable the prefab after the instantiation.

last sky
slate timber
last sky
#

Oh, that's too bad! Thanks anyway.

slate timber
last sky
slate timber
last sky
teal mortar
frozen raven
#

Can i check if file at addressable path exists ? i get a null if it doesnt
well i figured it out i think

fading totem
#

.
**Is anyone able to do this? ** 👇 It should be easy but I am too stupid to figure it out.
I want to just tick a folder as addressables. Yet when I do that all sprites have Path of Backgrounds/SpriteName. I used to just load by spriteName. Yet now that the path contains 'Backgrounds/' I cannot do that with only spirteName.

How can I still load by sprite name while having ticked folder, instead of ticking every single sprite❓

slate timber
#

Hey there, i have the following problem: i am loading the sprites for my project via adressables and it works. But i want to be able to preview the sprites in the prefabs using them ouside playmode. but assigning the sprites as direct reference would make the assets also included in the build right? So what would be my best option there?

serene sphinx
#

Pretty sure that's what you're after

slate timber
#

:S

slate timber
#

Because the Prefabs will be in the scene from the start but have hidden sprites which will be loaded from addressables

serene sphinx
#

So u make a empty game object "holder"(prefab) and instantiate the sprite to that "holder" empty game object.

serene sphinx
lilac hatch
#

how do i check latest addressable in server with the local ? and replace it if it was in game build

tacit yew
#

I'm using a plugin to drive my dialogue system, but I need to retrieve localized strings and all I have to work with as references are tags. For example, the tag might be...
#QuestText/Line28

I need to convert this to an actual localized string reference. How might I go about this?

indigo onyx
#

Hey everyone!

I've been using addressables for a while now in a proyect with some other people and have just now started using them on my own projects. I am facing a problem most of you have probably faced, so hopefully i'll find what im looking for.

I am calling Addressables.LoadAssetAsync() and trying to get the current percentage of the download process, but i have not been able to find a propper way to do so. I have already tried AsyncOperationHandle.PercentComplete and AsyncOperationHandle.GetDownloadStatus().Percent (in a coroutine withing a while to make sure it updates), and the result is always either 0 or 1, nothing in between, both in the editor and in a build. Has anyone had the same problem?

mild flax
zealous sinew
#

Hello,
I'm working on a project where people can upload FBX in our server and it creates an addressable with its catalog (each FBX has its own catalog).
For some reason, when I try to download these addressables sometimes it works but sometimes I get the message "Invalid Key Exception", for the same addressable with the same key and catalog, but even when it fails if I do a Debug.Log for the keys in the catalog, the key appears. (As shown on the image)

This is what I do:

  • When the addressable is going to be downloaded I do this first:
    catalogHandle = Addressables.LoadContentCatalogAsync(catalogUrl); catalogHandle.Completed += OnCatalogComplete;
  • And OnCatalogComplete I do this:
    addressableHandle = Addressables.LoadAssetAsync<GameObject>(key);
    This is the line that show the Invalid Key Exception.

Am I doing something wrong or missing something?
Thanks.

next cairn
#

What happens when you instantiate an object spawned using Addressables.LoadAssetAsync (since that doesn't actually spawn the asset by itself)?
I heard you're not supposed to do that, but LoadAssetAsync lets you use a specific type while InstantiateAsync doesn't

zealous sinew
#

If I try to instantiate the object after LoadAssetAsync is "completed" I get the message "The object you want to instantiate is null" while InstantiateAsync shows the InvalidKeyException.
It seems it always works the first time I try to instantiate the object, and afterwards it randomly shows the errors whenever I try to instantiate again.

next cairn
serene sphinx
#

Are you setting your "key". It should be a string value. I tag my addressables with a custom name, "prefab", and call that key to load them.

zealous sinew
next cairn
#

ah whatever I figured out a way that sidesteps the whole issue, thanks though @zealous sinew @serene sphinx

serene sphinx
compact geyser
#

In a async method, is handle.WaitForCompletion exactly the same as awati handle.Task?

quartz elk
#

Hi, I am using addressable system to build bundles. I am building bundles for another game and I want my bundles to depend on the game's bundles. For some reason CAB hash of the game's bundles are using md5 algorithm while my bundles are hashed using md4. Is there any way to change it, I have been looking at discussions and docs for days and couldn't find anything.

quartz elk
#

I don't know why, but enabling "Contiguous Bundles" in addressable asset settings switched hashing algorithm for cab files from md4 to md5, so problem solved

meager oak
#

Hey all! Is it possible to retrieve the assets guid (the guid which is displayed the .meta file) from an IResourceLocation object? I want to add an IResourceLocator object to the Addressables and this is working. However I also want to get and store a list of guids from all the Addressables in this locator object from a specific label. The guids are stored in the IResourceLocator.Keys list, but if I go through the keys list with a foreach loop, I can't check it's type

#

So specifically what I want to do is this:

resourceLocator.Locate(label, typeof(Texture2D), out IList<IResourceLocation> assetList);
assetList.ToList().forEach(asset => Debug.Log(asset.**GUID**));

But the asset.GUID variable is not available, so is there a way to get the guid?

Edit: the IResourceLocation has a member variable called AssetGUID, but this is only the path/key of the Addressable and not the actual guid

serene sphinx
#

I believe the path includes the guid, so you could use code to read and fix the path string to remove any unwanted characters, and check the guid that way. Substring removes so many characters at the beginning of a string. Look into that

#

Spitballing here. Coffee time☕

tribal garnet
#

Anyone have any quick references, tutorials / courses or tips for how to setup a project so that addressables can be included with a project but updated remotely via CDN post-build? I realize there's a lot baked into that question, but I'm mostly wondering what Addressable Profile settings or Schemas I should adjust to accommodate this and then if there's any particular code flow I should follow (ie, CheckForCatalogUpdates and then UpdateCatalog? Is that as simple as that part gets?)

barren ginkgo
#

Is there a way to create an asset reference dynamically using addressable name string?

steady quiver
#

Anyone have an idea on how to solve this? I've built my bundles previously and after a merge, every time I build a new one it gets me this errors based on a previous bundle that actually doesn't have this hash config anymore. Anyone knows a way to get rid of this error. I've tried to clear cache, clear unity library,... any other ideas, i'm open to

steady quiver
#

I saw that bundles are building correctly and stuff in local build, but it worries me to keep error logs as I'm planning on make a cloud build in the future and logs like that may cause the build to stop I suppose

tribal garnet
#

Any good tutorials or instructions out there on how to do seasonal content for assets that are already included in the build?

quartz elk
#

in case you mean that, here is how I do:

For seasonal asset groups, I set build path and load path to remote. Then by copying the catalog and monoscripts bundle to the remote path, I end up with the catalog, seasonal bundles and seasonal monoscript bundle

Only additional step is changing the monoscript path inside the catalog file from local to remote. And then you can just load that catalog with addressables in game

tribal garnet
# quartz elk Do you mean how to separate seasonal catalog from the game's own catalog while s...

Umm sort of... I'm still a little new to this so my understanding of how to structure my groups in general might still be a little green. The goal is to have address "Man" which is just like Assets/Textures/Man.png. Then I want to have a group called "Christmas" which contains an address called "Man" (like in the default group) but with a path of say Assets/Textures/Christmas-Man.png.

#

I'm not looking for a full suite kinda "Addressables 101" but just kind of a high level - Am I even in the right headspace as far as thinking about how addressables work?

quartz elk
# tribal garnet Umm sort of... I'm still a little new to this so my understanding of how to stru...

Not sure if it is possible, I have never tried (and I don't have godly amount of experience with addressables anyways) but here is a starting point that sounds similar to your goal https://forum.unity.com/threads/can-we-tell-the-system-how-to-handle-different-bundles-having-the-same-addressable-location.586642/

tribal garnet
fleet fox
#

Hi everyone, I have this weird problem that keeps on occurring, I am following unity essential and every time besides the first build I made, they do not work on unity play, they get stuck at 90 percent, all though I removed the zipping and brought it back, decreased performance did so many work around and nothing worked

#

The only difference between the one that worked and the others is that the one that worked I made it on 2019 editor and the others on 2022 webgl builds

prime field
dusky lion
#

Hi Everyone!

I am quite new to addressable asset model, and currently I am facing a problem. I have an addressable asset (a canvas which contains almost 100 images and is having some prefabs in a class which is attached with the canvas). When I am loading the game, it is taking too much time. Almost 3 minutes.
Do you have any solution to reduce the time? Thanks in advance.

The below script which I am using for handling addressable assets.

solid ice
lilac hatch
#

guys i wanna ask, so i've using addressable download from remote server. and when process more than 50% i minimize or open other app, when i'm back download it's completed but asset not loaded, and when i restarted the app it redownload again. idk why it return success and i want it check if it really success or not

acoustic spear
#

On Addressables i can`t unload a single item from RAM but i can using resources folder. Is resources folder superior?

hoary rampart
acoustic spear
#

What is the use case for resources? is it not deprecated?

hoary rampart
#

i mean they're technically still supported so... no?

acoustic spear
#

open world game streaming is hard with addressables

fading totem
teal mortar
slate timber
barren ginkgo
slate timber
#

Yes. Now i am testing something like this to load and unload them:

SoundSO:

...
public IEnumerator WaitForLoad(){
  Debug.Log("Loading AudioClip");
  yield return audioClip.LoadAssetAsync();
  Debug.Log("Loaded AudioClip");
}
...

This code is in another class and this method is an IEnumerator invoked by StartCoroutine();

...
  
  AsyncOperationHandle<SoundSO> loadHandle = Addressables.LoadAssetAsync<SoundSO>(audioName);
  
  Debug.Log("Loading SO");
  yield return loadHandle;
  Debug.Log("Loaded SO");
  
  Debug.Log("Loading SO fields");
  yield return loadHandle.Result.WaitForLoad();
  Debug.Log("Loaded SoundSO fields");
...

The problem is, this line "yield return loadHandle.Result.WaitForLoad();" freezes the game until it gets loaded even i try to start as Coroutine or IEnumerable. Any ideas?
I searched about Nested IEnumerators and people says "it should work".

slate timber
barren ginkgo
#

I'm not sure of the coroutine addressables workflow. It's a system mostly based on async/await. Is there a reason why your methods are coroutines instead of async functions?

slate timber
#

I will refactor and come back sadok

fading totem
#

Yet I have different problem now

slate timber
# barren ginkgo I'm not sure of the coroutine addressables workflow. It's a system mostly based ...

Okey so i tested it so much. It works with Async/Await but the result is the same since i cant start Async and Await with a Task.Run, its almost the same as IEnumerators as far as my researchs.
reference: https://medium.com/@sonusprocks/async-await-in-c-unity-explained-in-easy-words-571ebb6a9369#:~:text=To use async%2Fawait%2C you,an asynchronous operation to complete.

The key idea is that while the async operations themselves may not run on separate threads, they still allow the Unity main thread to continue processing other tasks and remain responsive.

Ive tested with this code:

public static async void LoadSoundSO(string audioName, Action<AsyncOperationHandle<SoundSO>> playAudio){
    // Load SO
    AsyncOperationHandle<SoundSO> loadHandle = Addressables.LoadAssetAsync<SoundSO>(audioName);
    await loadHandle.Task;

    // Load its fields. It gets stuck here.
    await loadHandle.Result.audioClip.LoadAssetAsync().Task;

    // Finally play with result
    playAudio.Invoke(loadHandle);
} 

I searched about MultiThreading with Unity. And i see we cant Task.Run normally without an overhead that dependent on MainThread. People says it will create overhead and the result would be a lag or some amazing bugs that u never seen in ur life before.

So even with this one, it lags while loading it. Idk if i am doing wrong, i just searched documentation and other places they use IEnumerator with Addressables mostly. Is it normal to lag while loading this AudioClip?

I looked with profiler tool. It does some FileRead methods. It says something like:

AsyncReadManager.SyncRequest

What who wanted sync notlikethis
I am thinking to use IJob. But I'm afraid it won't work?

fading totem
# slate timber Okey so i tested it so much. It works with Async/Await but the result is the sam...

if you don't mind using a library, use UniTask. I cannot live without it now that I know how well it works. You will never have to think about which one is multi threaded. Im using this in my code. Basically what you do is just do UniTask as a return method.

public async UniTask<Object> GetBackgroundFromStockLibraries(Ticket ticket)
        {
            
            var backgroundID = ticket.args.BgId.ToUpperInvariant();
            Object bg = GetPrefabBackground(backgroundID);

            if (bg is null)
            {
                var op = Addressables.LoadResourceLocationsAsync(backgroundID, typeof(VideoClip));
                await op;
                if (op.Status == AsyncOperationStatus.Succeeded && op.Result.Count > 0)
                {
                    var handle = Addressables.LoadAssetAsync<VideoClip>(op.Result.First());
                    await handle;
                    ticket.assetHandle = handle;
                    bg = handle.Result;
                }
            }
slate timber
#

I will give a shot

#

Interesting but i feel sad for unity team while reading this kekwait
ref: https://neuecc.medium.com/unitask-v2-zero-allocation-async-await-for-unity-with-asynchronous-linq-1aa9c96aa7dd

If you look at it this way, there’s nothing special about Unity’s coroutine. PlayerLoop(ScriptRunDelayedDynamicFrameRate) drives IEnumerator, it only calls MoveNext on every frame. UniTask’s custom loop that not much different from a coroutine loop.

However, Unity’s coroutine is an old-fashioned mechanism, and due to the limitations of yield returns and high overhead, it’s not an ideal mechanism.
barren ginkgo
slate timber
#

mp3 AudioClip

barren ginkgo
#

if it's an AudioClip you shouldn't need to load it?

#

Could you share SoundSO

slate timber
#
[CreateAssetMenu()]
public class SoundSO : ScriptableObject {
    public AudioClip audioClip;
}

But now currently i changed to:

[CreateAssetMenu()]
public class SoundSO : ScriptableObject {
    public AssetReferenceAudioClip audioClip;
}

AssetReferenceAudioClip

[Serializable]
public class AssetReferenceAudioClip : AssetReferenceT<AudioClip>
{
    public AssetReferenceAudioClip(string guid) : base(guid){}
}
barren ginkgo
#

what is AssetReferenceAudioClip

slate timber
#

An extension i added that i saw its possible from some tutorials

barren ginkgo
#

could you share it as well

#

Those all seem like they should work. Have you tested doing Addressables.LoadAssetAsync<AudioClip>("clip_name") to see if you have an issue with your addressable groups?

slate timber
#

One second notlikethisatwhatcost

#

yes now i tested it and still main thread gets lagged

barren ginkgo
#

are you testing in the editor?

slate timber
#

yes

barren ginkgo
#

If so what is your play mode script set to? Because Use Asset Database should not even lag for editor, which makes me think something else may be causing an issue.

slate timber
barren ginkgo
#

Also where do you call public static async void LoadSoundSO(string audioName, Action<AsyncOperationHandle<SoundSO>> playAudio){ that makes the game halt?

slate timber
#

Oh i revert that change to IEnumerator right now. Its from a static function named "PlaySound(audioName)" and directly calls LoadSoundSO. And LoadSoundSO's action is doing AudioSource.Play();
Its looking complex for now but i will refactor if loading will work.

barren ginkgo
#

As long as a sync method does not await an async one, be it a coroutine or an async function, your game loop shouldn't halt

slate timber
#

I think i realized something interesting!

#

This is lagging at first try of loading AudioClip. On the second try, it doesnt lags. Its on purpose? UnityChanOkay
I will test on an APK

barren ginkgo
slate timber
#

I released it before loading the second

#

Um

#

It works perfect in mobile

#

now i downloaded an audio that costs 84 MB UnityChanThink

barren ginkgo
#
public static async void LoadSoundSO(string audioName, Action<AsyncOperationHandle<SoundSO>> playAudio){
    // Load SO
    AsyncOperationHandle<SoundSO> loadHandle = Addressables.LoadAssetAsync<SoundSO>(audioName);
    await loadHandle.Task;

    // Load its fields. It gets stuck here.
    await loadHandle.Result.audioClip.LoadAssetAsync().Task;

    // Finally play with result
    playAudio.Invoke(loadHandle);
} 
#

your handle seems to be local

#

I am not sure whether the handle's lifecycle ending necessarily unloads the object

slate timber
#

I am doing this rn

AsyncOperationHandle<AudioClip> loadHandle = Addressables.LoadAssetAsync<AudioClip>("Music-ChillVibe_AudioClip");
AsyncOperationHandle<AudioClip> loadHandle2 = Addressables.LoadAssetAsync<AudioClip>("Music-OurFuture_AudioClip");

await loadHandle;
await loadHandle2;

audioSource.clip = loadHandle.Result;
audioSource.Play();

await UniTask.Delay(10000);

audioSource.clip = null;
Addressables.Release(loadHandle);
Addressables.Release(loadHandle2);
barren ginkgo
#

A good practice is to cache the handle on objects that you know may no longer be required, and call Addressables.Release on it after the flow makes it redundant.

#

Ah great, sorry

#

you can simply do audioSource.clip = await loadHandle btw

#

or you can do Task.WhenAll(loadHandle.Task, loadHandle2.Task) at least normally. I'm sadly not familiar with unitask

slate timber
#

Yep its just for test

#

Yea unitask i dont know it looks like the same of IEnumerator but kind of an extended version. We will see .D

barren ginkgo
#

Have you tried running Addressables.Initialize when you start your application? It may be causing the initial delay.

slate timber
#

OH!

#

You may be right!

#

It was automatic and i didnt touched it

#

wait after this amazing test i will try initializing

#

Um i tested it with .exe and is that right? lmao it was just 84 mb. Whatever!
It works without lag.
Thank you for helping me.

cobalt axle
#

Hi I have a problem I try to move our scenes to addresable system, but, I can't see any memory differences, RAM usage is still high

#

I have only scenes in Addresable Groups

teal mortar
#

hmm where are you expecting to see a difference? scenes don't take up memory until they're loaded, addressables or not, so this shouldn't be too different

cobalt axle
#

it doesn't work like it spawns and removes objects that are in that scene freeing up memory?

teal mortar
#

can you explain what you're trying to do?

cobalt axle
#

I have multiple scenes on a large map, these scenes are like bioms I want to load textures, models from this bioms when I reach certain point on the map

#

should I change this scenes to prefabs? and load prefabs instead of scenes?

teal mortar
#

what's the problem? is there a difference in memory usage you're expecting to see?

cobalt axle
#

I have textures, models, etc. that I don't use and they are in memory

#

I want to remove them from memory and load them when needed

teal mortar
#

that sounds like they're being referenced from somewhere else, are there any other reference to those assets in the project? using addressable scenes or prefabs won't make a difference if so

#

you could try the memory profiler package, it's good for finding references like that

cobalt axle
#

yes, they probably have some common objects, do shaders count as well?

#

e.g. I have cows that are in different scenes, is that enough to not free up memory?

teal mortar
#

the "Check Scene to Addressable Duplicate Dependencies" thing in the analyzer is saying you have lots of assets references in your scene that are also in bundles

#

make sure the addressable scene aren't in the editor build list first of all! that's an easy thing to miss

cobalt axle
#

oh..

#

it is

cobalt axle
#

as i understand correctly i have 8 duplicate items in main menu and 1104 in levels prototype which are used by addressable? UnityChanSalute

teal mortar
#

yeah, it looks like you need to check what assets those are and make sure LevelsPrototype isn't referencing them at all

cobalt axle
#

or I can check levels prototype as addresable too?

teal mortar
#

sure, but then loading that level through addressables would still load those assets, so you wouldn't save memory

cobalt axle
#

no problem, I'll break them down into individual scenes later, thanks

teal mortar
#

if there's assets in that list that should only be loaded when the other levels load, you should be able to remove the references

warped quiver
#

hi! i am using remote datas for adressables. When i build for production. Should i build for android and ios seperetly or one build for both of them is enought for bundle folders?

viral orchid
#

Are there any tutorials out there how to combine Addressables with AWS SDK for getting the content from a private S3 bucket?

warped idol
gaunt kestrel
#

Any suggestions on where to host remote addressables? I have previously been using an S3 bucket, but that requires me to create and upload the addressable assets manually, because AWS SDK conflicts with Addressables in an irreparable way.

olive magnet
#

Hi, is it possible to use Addressable Scene Loading with Netcode for GameObjects?

neon pilot
#

i have a question, im loading some scenes with addressables and async, but with my actual code when the next scene is loaded, there is a frame where exist both main camera and then i can see noticed there are 2 audio listener

#

so, how can i prevent this, before the success of load this scene i cannot disable the loading scene, is better to use then loadscenemode.single?

#

should i use only additive when is and addition of the actual scene, but if we move to menu from game etc is better to use single?

neon pilot
#

yes

#

this is

wintry karma
#

I have a problem with addressable assets when building the project. It is completely OK in the editor.
There is a collection list with 90 elements. They are SOs. It is OK in the editor as I mentioned but in runtime, it logs 360!!! and then I get an exception exist same key because they are populated into a dictionary

shell python
#
  • Hi. Is there any way to verify through the editor window or inspector whether an asset is actually loaded or not? I'm designing a system to dynamically load and unload assets, and not being able to check whether it actually works is a horrible feeling
#
  • One more thing: when i release a handle, the asset can be unloaded despite being referenced, right?
viral orchid
#

I have another problem: WHY on god's earth are remote load paths not relative? Why does the catalog have a HARDCODED absolute path to the .bundle files?

#

If I change my remote server address (e.g. my AWS S3 bucket name, or the region), I have to update all bundles. The hell?

viral orchid
#

Okay, I actually found a workaround.

#

Wait for it.

#

My remote load path set in the editor is: https://example.com/[BuildTarget]

Then I override Addressables.WebRequestOverride with a new method.

In that method I simply replace "example.com" with the bucket address, "my-private-aws-bucket.s3.eu-central-1.amazonaws.com"

And it loads.

IF I DON'T include "https://example.com" in my remote load path before building the Asset Bundle, it does not trigger the WebRequestOverride. Instead it looks locally and I have no chance of replacing the bucket address.

#

Plus I still have to mangle with the url to add the AWS Authorization stuff.

late vigil
# neon pilot

Just a suggestion here. If you are concerned about memory spiking, you might want to consider loading an empty scene between adding and unloading scenes. Otherwise there will be a moment where two scenes are in memory at same time.

frank lagoon
#

Anyone ever tried for an addressables to play a video?

#

Especially for Android

#

Since my current mp4 only runs at editor but won't shows up at the android

warped quiver
#

hey how can i secure my remote adressable target for example example.bunnycdn.com , users can see requests

#

how can i hide url from attackers

warped quiver
#

?

neon pilot
late vigil
neon pilot
#

Yea, right now changed to single mode because I don’t need it for move from to game to menu, but I have other projects where I have to load some parts of maps as another scene , I will take your suggestions for those case where can be required

late vigil
#

Oh I see what you're saying 👍

wintry karma
#

I have a problem with addressable assets when building the project. It is completely OK in the editor.
There is a collection list with 90 elements. They are SOs. It is OK in the editor as I mentioned but in runtime, it logs 360!!! and then I get an exception exist same key because they are populated into a dictionary

slate timber
#

I have an SO. How can i load that asset only once?
I see AssetReference's can be loaded only once and does not increments the ref count but the ones with AsyncOperationHandle does increments the ref count which is not wanted in my case.

I made it work by creating a dictionary and saving the Addressable Asset's Address in it. So i can check it.
I searched it but still, i dont know if addressables have a pool thing to get currently loaded resources.

neon pilot
#

I think there is something like this in the project chop chop but I’m no t sure

neon pilot
slate timber
#

This project seems big. How can i find it? Do you remember anything about it?

shell python
#

- When i load many assets via the addressable's .LoadAssetAsync method, do they all load simultaneously or are they queued?

vast rivet
#

I have a question about functionality of addressables, because maybe I am misunderstanding.

  1. I built a scene with an object in it (say, a car) that is an addressable. Addressable in the scene is called "currentObject." Run the EXE and see the car, that's fine.

  2. In my Unity scene, I load a new FBX in (say.. a plane). Removed "currentObject"-named addressable (the car) and reassigned this new plane as "currentObject" instead (renamed it to that). Build addressable group, press play in Unity, I see my plane appear instead of car.. great so far. I see that it's updated my addressable in my LiveOps unity bucket.

  3. Run my previously-built EXE which, I expect, is still going to grab my addressable from the server. It still shows the CAR, not the plane (I want the plane). What am I doing wrong? Should addressables not be used in this manner to achieve what I am intending?

leaden thistle
#

hey there
im having an issue with addressables, it just wont load the scenes in a build
i built the player and addressables too
it just hangs there at the part of the code which shouldve loaded an addressable scene, but it won't get past that
no errors whatsoever, empty player log. I get a debug that i placed right before addressables.loadsceneasync and from there on nothing, blank player log

patent escarp
leaden thistle
#

just put a debug to see if it gets there

#

this is all, a simple startup scene, and from this scene i just wait a little and call the load of my actual login scene

#

i get the debug in my player log

#

and from there on the player log is empty

#

and the game hangs

#

this is the player log

patent escarp
#

Can you put another debug after the load scene call?

leaden thistle
#

yup let's see

slate timber
#

"fatal alertor"

#

Case sensitive file?

patent escarp
# leaden thistle and the game hangs

I suggest connecting the debugger and breaking when the game is frozen. Then inspecting the callstack of the main thread. It's likely stuck in an infinite loop somewhere.

slate timber
#

How do I move my project to case insensitive file

leaden thistle
#

yep the 2nd debug is called too, still hangs

patent escarp
#

Yep, well, do what I suggested.

leaden thistle
#

yeah well im not too familiar with debugging from visual studio honestly

#

can you attach it to a build too?

patent escarp
#

Yes. There's a checkbox in the build options to allow you the attachment of the debugger at the very start of the game.

leaden thistle
#

oh, true

#

got it, thanks!

fickle wasp
#

Hello there!

I'm trying to build my project from Jenkins, and everything is going well except one thing. When performing batchmode build - addressables build artefacts are not copied into the target folder. StreamingAssets folder is missing entirely. Do i have to add additional arguments to batchmode or is there a method that i have to call before or after the build is finished? If I build manually from Unity, by calling the same method as Jenkins does, everythnig build perfectly. So the problem is somewhere in batchmode.

P.S. Wiki for Addressables Package has a version selector that goes up to the version 1.20, but current version 1.21.15. Can you please update the wiki?

leaden thistle
#

something is sus here

#

i load the scenes normally now, for a test, to see if other addressables work, and it turns out the other addressables dont show in the build neither

#

is it more to it than just building the addressables?

#

in unity editor everything works fine

frozen raven
#

System.Exception: Unable to load asset of type UnityEngine.GameObject from location Packages/building/Item/Movement/Wheel/Wheel.blend.

#

can I not load .blend files ?

#

i load them as <GameObject>

prime field
#

Those will work as GameObject, I'm pretty sure

tranquil burrow
#

Good evening, and thank you in advance to those who will take the time to respond.

I want to procedurally create rooms, where each room would consist of a floor surrounded by walls. In order to avoid monotony in the design, I would like to generate several variations of 3D models (in FBX format) to represent the walls, potentially up to a hundred different variations. Ultimately, there might be around thirty different rooms.

For my current testing, I retrieve the file path of the 3D models from the "Assets/Resources/Walls/" directory (with names like "wall0", "wall1", etc.), using the Resources.Load<GameObject>(filePath) function, and then I instantiate these objects using Instantiate(...). This approach works correctly.

However, I've read that using the "Resources" directory is not optimized at all and it's recommended to avoid it. So my question is: what would be the most efficient and clean way to load my 3D models?

warped quiver
#

hey i am using Addressables.WebRequestOverride action to add my token for remote adressables. But its not working in android platform 😦 it is working in editor. I am using SHA256 sha256 = SHA256.Create() for generate tokens

fickle wasp
#

Does anyone ever respond here?

slate timber
clear helm
#

Hey does anyone know if I am able to use a Unity CCD bucket to hold non addressable related files? I want to use one to hold a screenshot and a txt file and then pull those at runtime

steady quiver
#

So I decided to update unity version, then it's not loading a specific material group i've built a shader, it's weird cause it was running before (2019.3.9) but now is failing to render it. No loading errors and missing refs. Anyone got an idea?

#

Could it be a shader problem? from version?

lucid swallow
#

Any idea why this is happening? We have addressables, it wont build manually. If I set to build with a platform build, it also hangs. This project will build on my laptop, but not on my PC. Help please.

late vigil
#

What's the editor log file say?

dark granite
#

I constantly get this error and my patch building gets stopped:
Asset has disappeared while building player to 'globalgamemanagers.assets'

night helm
#

Are addressables and additive scenes the way? Kinda new to this part of unity

#

like from what i understand i probably want an empty scene that contains the persistent managers and scenes for every different 'level' ?

turbid zephyr
#

Pretty much yeah

robust elbowBOT
#
Posting code

📃 Large Code Blocks
Large code blocks should be posted as links to services like:
https://gdl.space/, https://paste.ofcode.org/, https://hatebin.com/
https://paste.myst.rs/, https://hastebin.com/

📃 Inline Code
Surround code with three backquotes. Not quotation marks.
To get C# formatting the first line should only contain cs or csharp.
Add a comment with a line number if there is an error message.
```cs
// Your code here
```
Do not share screenshots of code unless requested.

vernal pawn
#

Hey, Addressables is somehow causing trouble for the Localization system

#

Everything has been running smoothly for months, and then suddenly without warning our game always crashes on the first run, with this error for each of the localization tables:
System.Exception: Unable to load dependent bundle from location Assets/GMB/Localization/Strings/NAME OF TABLE_en.asset

#

Stop the game and run it again, and everything is fine

#

Any idea what could be causing this?

molten wing
#

we're using a in-house framework which is combination of Addressables + UniTask.
works like a charm,
but there's one problem, at one place i've to do Synchronus loading but i'm recieving UniTask<TObject> from framework, and i'm not able to find a way to Synchronously execute that task,
i know it's a bad practice but it's a legacy system and it don't support async execution

teal mortar
molten wing
teal mortar
#

well you can just do something like while (task.Status == UniTaskStatus.Pending) { } but that's why you need to know what it's waiting on, it's an easy way to lock up your game

#

addressables knows that load operations are completed on a different thread, so it's safe to call WaitForCompletion which is implemented like that, so if your task is just waiting on an addressable asset, it might be OK

molten wing
#

so putting wait anywhere else on the task, freezes the whole application because AsyncOperation's update in ResourceManager stops for being on the same thread

teal mortar
#

huh, checking out the source and apparently WaitForCompletion actually throws on webgl because it doesn't have threading, even if most operation types can run synchronously 🤔

#

i guess to allow for custom operations that do use multithreading

molten wing
#

to wait(sync execution), you need the access to UniTask source to update that manually

teal mortar
#

it's not really anything to do with unitask, you probably need to look at this mystery method you're calling from your framework and see if there's a way to make it synchronous or ensure the result is ready by the time you need to wait for it

#

unitask's job is just to tell you when it's done, it can't make it get done any faster

slate timber
#

Quick question is Async/Await safe with addressables system?
I am planning to make manager that returns the loaded object to me.
I am scared to use Async/Await. I will use .Completed

teal mortar
long veldt
#

How do I build assetbundles (with shaders in them) without having them corrupt?

#

I've been trying to mod my own shaders into a game using assetbundles, but whenever I use either a script or assetbundle browser to build the bundle, it seems to be corrupted

#

The build completes without errors, but when I try to load it into the game it gives me a generic "failed to read header" or "failed to decompress" error

#

And when I use UABE it gives me something along the lines of "Failed to read type database file"

#

Someone else has already succeeded in this but I when I asked them how they did it they just said "I can't help with this, I didn't have any problems with building the assetbundle"

molten wing
#

Addressables: is there any way i can combine the (label + key) to create asset key to load asset ? without changing the assets keys in the editor

slate timber
#

AssetReference.InstantiateAsync tells me this:

InstantiateAsync the referenced asset as type TObject. This cannot be used a second time until the first load is released. If you wish to call load multiple times on an AssetReference, use Addressables.InstantiateAsync() and pass your AssetReference in as the key.
See the Loading Addressable Assets documentation for more details.

But i can load as much as i can atwhatcost

#

Like look at this example:
Ref: https://docs.unity3d.com/Packages/com.unity.addressables@1.21/manual/asset-reference-create.html

`using UnityEngine;
using UnityEngine.AddressableAssets;

internal class InstantiateReference : MonoBehaviour
{
[SerializeField]
private AssetReferenceGameObject reference;

void Start()
{
    if (reference != null)
        reference.InstantiateAsync(this.transform);
}

private void OnDestroy()
{
    if (reference != null && reference.IsValid())
        reference.ReleaseAsset();
}

}`

In the OnDestroy, the reference.IsValid() is returning **false **always.
I think this documentation written wrong. As far as from my tests, the only a loadhandle can be Instatiated once.

late vigil
slate timber
#

Do we need to mark the assets inside prefab as addressable too?

teal mortar
slate timber
#

.d yeah i realized this like mins ago. The memory profiler showing wrong in the editor

slate timber
teal mortar
#

how you set that up depends on your project and how you set up your bundles etc so there's no universal answer, but if something is only referenced from one asset, you shouldn't need to mark it

#

you can check the dependencies in the addressables analyze view and the build report window to get an idea of what depends on what

slate timber
#

Hm so it can make a duplication

teal mortar
#

yup

indigo onyx
#

I am using the Addressables Package to create a localization tool and i have a doubt.

I have a group of SOs which are all part of an Addressable folder. 1 of these SOs (LanguageSheetSO_Default) has a direct reference to every other SO in this folder. I download the entire thing by label.

My question is, since all of these SOs are within the same Addressable folder, is it okay for LanguageSheetSO_Default to have direct references to the other SOs or should they be references as AssetReference? Does having them as direct references cause duplication? This package is really testing my patience and its not particularly intuitive.

late vigil
indigo onyx
late vigil
#

Yes

indigo onyx
#

i see.

What if instead, i had 1 addressable folder that just held the Sheet scriptable and another addressable folder to hold all the SheetTab scriptables? Should i use AssetReference in that case?

turbid zephyr
#

You won't need to. The difference is if you put the Sheet scriptable in the same bundle (addressable folder in this case) then you only need to load this one bundle when use the Sheet or tab(s). But if you were to put the Sheet scriptable in its own bundle, then one of them would be dependent on the other so both bundles would need to be loaded. Nothing is duplicated in either case. Only difference is that you have a little overhead having that one file in it's own bundle. No biggy in either case

indigo onyx
#

i see, in that case i guess it does make sense to group it all together in the same bundle as it is right now, much more understandable. Thank you!

slate timber
#

Lets say i got an FBX that has Materials assigned with Textures for that example

slate timber
vale ferry
#

Nice to have this forum topic addressabe, without catalog or making manual a list of instanciate, show us please a sample where addressable can load scenes complete with their prefabs ?

lucid swallow
vale ferry
lucid swallow
vale ferry
#

have you libre/open office that you need java for special excel sheet scripts?

lucid swallow
#

We're building for mobile, using the Android platform, which requires it.

vale ferry
vale ferry
# lucid swallow We're building for mobile, using the Android platform, which requires it.

docker should give full speed to build java, i have read but not try myself, but if you have success on it that tell us, https://www.infoworld.com/article/3638548/how-to-use-docker-for-java-development.html

InfoWorld

Take advantage of Docker to ease Java development. Learn how to update a running Java codebase (without restarting the container) and to debug into a remotely running containerized Java app.

slate timber
#

The right one stays the same even it unloads and loads some meshes in test project. Am i looking at right thing?

teal mortar
#

measuring with task manager won't tell you anything useful for unity most of the time, better to use the unity memory profiling tools

slate timber
turbid zephyr
#

As long as you aren’t having those dependencies directly referenced in a scene or other objects using it directly that are not in a bundle

slate timber
#

Okey there is only two asset bundles

#

This is after the unloading all of the meshes. The memory still does not changes. Instead, the loaded things stays as "reserved" and it goes to "Unknown" memory. After loading, the unknown memory giving its space to new loaded object. After loading the object, it allocates some more MB in Unknown memory and it repeats. I will investigate more and update here.
I think i found there is a more advanced memory profiler that shows almost everything in an app. Some of the people accessed through "Unknown" memory by using it. I will test it out.

slate timber
slate timber
#

Ookey after a day of research, i've MAYBE found the answer of this.
GC tries to find the balance of GPU and CPU in memory. The way he does that, using POOLING! MAN UNITY USES POOLING FOR MEMORY!? yes. Right now, i testing with one mesh and its textures, the "Unknown" memory gives its memory when loaded, and takes when unloaded acts like a pool.
Ok we found answer but how does it works? It does by the "Fragmenting". Basically lets say you have three class and two of them loaded. Now two is unloaded and third is loaded. But third takes same or less memory than the two. Then it puts into the two's place instead of creating new memory for third. But imagine you're doing this rapidly. Well, i think this is where Memory Leak starting to happen.
Ref: https://docs.unity3d.com/Manual/performance-managed-memory.html // Memory fragmentation and heap expansion

So in my case, i was loading a little bit much async handles and the GC said "Bro, your handles are too much to handle. Let me pool it".

vernal pawn
#

Still having trouble with the Unable to load dependent bundle from location error, which crashes the game at startup. Waiting for Addressables.InitializeAsync and LocalizationSettings.InitializationOperation at startup, but no dice. Also tried loading localization data synchronously. The really mindblowing thing is that the error seems to present randomly. The bug happens occasionally but frequently, with no seeming pattern.

neon pilot
#

hi there! percentcomplete only can be used to show progress on download content? i want to make a loading slider for my scene manager of addressables scene, but percent is not working

neon pilot
#

so after searching in the whole web and the unity forum i think percentcomeplte only works for downloable content and not for loadasync and scene additive

late vigil
slate timber
#

Can we change the location of AddressableAssetsData? or literally they using a string to tell where it locates 💀 ?
Yes it does uses string for path and you cant change. They should make this changeable atwhatcost
AddressableAssetSettingsDefaultObject.cs

vernal pawn
#

Thought 2021 didn't support that, but turns out it can be done by haxxing the manifest

long veldt
#

How do I build assetbundles (with shaders in them) without having them corrupt?
I've been trying to mod my own shaders into a game using assetbundles, but whenever I use either a script or assetbundle browser to build the bundle, it seems to be corrupted. The build completes without errors, but when I try to load it into the game it gives me a generic "failed to read header" or "failed to decompress" error, and when I use UABE it gives me something along the lines of "Failed to read type database file". Someone else has already succeeded in this but I when I asked them how they did it they just said "I can't help with this, I didn't have any problems with building the assetbundle"...

tranquil remnant
#

Did some searching and couldn't find an answer so asking here. We have a game with some randomly generated items, similar to Gacha. That randomly generated item will be just a picture, but we want to make it Addressable. The problem is that Addressable's address might not exist, so it wouldn't be in the catalog, which means for each new generated item we'd have to make a new build. Is there a way to dynamically generate an Address without making a new build? Another way to achieve the same thing is to pre-generate some items and add their Addresses into the catalog, then assign those addresses to users. Thanks in advance for any help.

hoary stratus
#

How addressables works with shaders? For example I have A and B scenes. Both of them uses URP/lit shaders. I have three packages in addressables: A scene addressables, B scene addressables, shaders addressables. A and B have some different shadeer variants (different material settings a bit.), how should I handle this situation, as currently my memory profiling return URP/Lit shader taking 25 mb memory. How ever when I using non addressables approach, it shows 5mb memory usage on URP/lit shader. So I assume that addressables compiles all shader variants used in all different scenes and combines into big shader. Shoudl I put URO/Lit shader in each Scene addressables package to reduce memory usage?

slate timber
hoary stratus
#

How addressables works with shaders?

whole comet
#

Hello everyone, I have problem with loading addressables. It throws error: Error while downloading Asset Bundle: Failed to decompress data for the AssetBundle
I have my scenes as adressable. Some of them works but some don't. They have same group settings. Any idea?

tame moat
#

Hello so i started learning and working with Addressables anything i should be careful of and any advice is appreciated

random mango
atomic void
#

hello, is it possible to keep a valid reference of an object loaded with Addressables and then release the handle?

#

I tried to use Instantiate to keep a valid reference before call the release, but while the object itself is valid, a internal variable of it is not for some reason

#

if I got this right, I must always release the handle, otherwise it can cause memory leaks and other performance issues, that's why I'm stuck with this

lunar shard
#

If you're talking about the handle from LoadAsset, as far as I know unloading that handle tells all the AssetBundles you have loaded for that asset to unload as well I believe you can safely unload the handle, yes, but you just should not unload the Result of that handle. Doing that unloads the AssetBundles.

#

you are meant to keep it around for the life of the asset and use it to unload the asset bundles after you no longer need it

#

keeping the handle probably has some memory usage, but it's nothing compared to the assets themselves

lunar shard
#

**Scenario: **

  1. I request Addressables to load 50 catalogs using Addressables.LoadContentCatalogAsync.
  2. After each AsyncOperation is finished, I request a Addressables.LoadAssetAsync for a key that was inside that catalog.
  3. None of my Addressables.LoadAssetAsync requests are processed until the catalog requests are done.

Question:

Does Addressables internally queue up all of its AsyncOperations to run on the same buffer?

My hope was that I could call any number of Addressables.LoadContentCatalogAsync requests and have Addressables.LoadAssetAsync requests processed completely independently and ideally as soon as each Addressables.LoadContentCatalogAsync is completed.

turbid zephyr
#

Why 50 catalogs?

lunar shard
#

Because I build catalogs in such a way that I have 1 catalog per prefab (as a simple example).

#

So a tree is a catalog, and a bush is another catalog. The idea is to stream them in (or unload them) on demand.

An example of a game that would do this is VRChat, where user generated content is made by players and loaded in on-demand.

#

I actually have 500 catalogs at the moment, but wanted to show that this is happening with 50 as well.

atomic void
# lunar shard If you're talking about the handle from `LoadAsset`, ~~as far as I know unloadin...

yeah, I'm releasing the handle.Result, I believe it's the right choice cause like you said, the memory usage is in the asset, not the handle. The thing is, the behavior is erratic, sometimes the textures references I need work as expected, sometimes they don't. If I just get rid of the Release() call altogether, everything works, but then the RAM usage is cumulative as the project cycle happens, which isn't sustainable.

#

I even tried to create a new list using something like "new List<MyData>(handle.Result.myData)" just before call the release, but it doesn't work either, when the problem happens, the file is "cursed" lol, especially regarding what I need, which is just a couple of textures

#

I can provide more details, but I don't wanna flood the chat, I'm kinda desperate cause my project is big and I'm being forced to delay the release because of this problem

hoary rampart
lunar shard
#

Thanks for the suggestion, but I am very rigid on the

"Want to load a tree? Then download the tree catalog that has all the info on what you need to load that tree without getting anything that has to do with that bush."

architecture.

The goal is to make my assets as atomic as possible.

I am just trying to figure out if Addressables is able to let me load assets while I am asking for other catalogs simultaneously.

hoary rampart
lunar shard
#

Let me rephrase, I don't want my catalog to have any more information in it than is needed to load a tree.

#

I don't want my catalog to have information on how to load a bush, unless I want to load a bush.

#

The goal is two fold. Let's say 2 years from now I decide to make a bench. So I export a bench catalog and the assets that represent the bench.

By not making 1 giant catalog, the players do not have to redownload it. The tree and bush catalogs can remain the same and cached on the user's machine.

The player only has to download the new bench catalog and whatever assetbundles they are missing.