#📦┃addressables

1 messages · Page 8 of 1

nimble plume
#

Yes this is possible. One way is to Build With the Groups set as Local and then do a full build so it bundles everything together, You can then change the groups to be remote and do another build later if they need updating. You can then perform a catalog update to detect that the groups are available remotely and can be updated.This user is doing the same https://forum.unity.com/threads/case-1343032-updating-localization-through-addressables-causes-system-exception.1125758/

wanton pewter
#

i have french and spanish versions of a project. is there any way i can make a spanish build from the editor that only includes spanish audio files by using addressables?

meager grail
nimble plume
meager grail
#

No they are exactly the same. Addressables.InitializeAsync ends but LocalizationSettings.SelectedLocaleAsync never ends when there is no internet connection. So, I can get my regular game objects, images, etc. but not localization string tables.

#

But now that I think, I access the other game objects directly until they are loaded. After they are loaded I update them from asset references. But with localization we don't directly use string tables and use string table asset references so it makes sense that they are not working the same way.

rigid shadow
#

Would anyone be able to elaborate how to use Addressable's Labels as an alternative to Resources.LoadAll()?

orchid crypt
#

hi all! noob question: how to batch loading if i have AssetReference[] array? I see Addressables.LoadAssetsAsync which requires IList<IReourceLocation> but how to use it with bunch of AssetReference?

shrewd geyser
#

I don't think you can pass the array of AssetReferences to LoadAssetsAsync. However, you can loop over your asset references, take their RuntimeKey and add them to a list (or array - whatever floats tickles your fancy.)

List<object> keys = new List<object>(assetRefs.Length);
foreach(var assetRef in assetRefs)
{
  keys.Add(assetRef.RuntimeKey);
}

Addressables.LoadAssetsAsync(keys);
rigid shadow
#

How the heck does everyone only seem to use equivalents of Resources.Load, and nobody uses Resources.LoadAll? Does no one need to load multiple objects of a certain type? There's absolutely no tutorials on how to do this

low halo
orchid crypt
#

@low halo @shrewd geyser thank you for answer. I have tried to extract RunTimeKey and it seems like simple code but something goes wrong and produces errors which is something about key invalidation so i have finished with just AssetReference.LoadAssetAsync and counter.

rigid shadow
#

I'm trying to understand it but I can't seem to get even the most basic example working. I also don't know where labels come into play in regard to this.

rigid shadow
#

It doesn't seem like I can load anything that isn't a gameobject

#

I can't load a Sprite or a TextAsset file

#

the error I get is:

Exception encountered in operation Resource<GameObject>(DrySoil.yaml), status=Failed, result= : Unable to load asset of type UnityEngine.GameObject from location Assets/Resources_moved/Defs/Tiles/Base/DrySoil/DrySoil.yam

#

Any ideas?

orchid crypt
rigid shadow
#

I save it an a list where I define the type, such as List<GameObject> Assets

#

It's weird because it works flawlessly for actual gameObjects

#

But when I change it to

#

List<Sprite> Assets

#

And try to load a sprite

#

I get that error

#

It should work because my method takes a generic T parameter, aka Object. And sprite derives from object. So I'm not sure what I'm doing wrong

orchid crypt
#

The exception says that you trying to load DrySoil.yam

cedar loom
#

Does anyone know how I would take multiple asyncHandlerOperations and wait for them all to complete before triggering an callback ?

low halo
rigid shadow
#

I need to load assets other than gameobjects

#

What's wrong with that? Loading yaml files and images?

rigid shadow
#

Here's my ENTIRE code. The only thing I'd expect that I need to change is the type of the Assets List, I don't need GameObjects but Sprites in my case

#

and this still doesn't work

rigid shadow
#

Can someone please help me out?

frank panther
#

Well, the exception says that you can't get GameObject from YAML file

#

GameObject assets are in PREFAB files

rigid shadow
#

I know what the exception says...

#

What I want is to load a non-gameobject

#

Like a text file or a string

#

@frank panther

frank panther
#

Are you just experimenting? From the first look it seems strange that you're loading assets on Start, why not just reference them, i.e., without using Addressables?
When is this script loaded?

rigid shadow
#

Let me explain what I need and why. I am storing my data about let's say a certain tile (Grass) in a Grass.yaml file. There I can set the walkspeed variables, generationHeight variable and even more importantly, which texture should be used for this Tile (by only writing the name)

#

I'm pretty sure I NEED to load .yaml files on Start, and as a bonus, I should be able to reload them whenever I want and see changes in real-time in game

#

But even leaving all of that behind, what I currently want to figure out, that would probably make the rest of it make sense, is why the above code just doesn't want to load a sprite

#

It's a generic type T : Object so any Unity object should get loaded, including Sprite or TextAsset

frank panther
#

T is generic, but you're passing object of concrete class, which in your example is Sprite

rigid shadow
#

Okay

#

Do you have any advice on how I should handle this?

#
public static async Task InitAsset<T>(string assetLabel, List<T> createdObjs) where T : Object
    {
        var locations = await Addressables.LoadResourceLocationsAsync(assetLabel).Task;

        foreach (var location in locations)
        {
            createdObjs.Add(await Addressables.LoadAssetAsync<T>(location).Task);
        }
    }

    public static async Task InitSprite(string spriteLabel, List<Sprite> createdSprites)
    {
        var locations = await Addressables.LoadResourceLocationsAsync(spriteLabel).Task;

        foreach (var location in locations)
        {
            createdSprites.Add(await Addressables.LoadAssetAsync<Sprite>(location).Task);
        }
    }
#

InitSprite is basically the same method but specialized for loading a sprite

#

would this work?

frank panther
#

As I see your problem - you have marked different types with some label, and are trying to load them as one type
One way to fix this would be to use a label on one type of assets

rigid shadow
#

I don't think that is the problem

#

I've only ever tried to load the one type at once

#

and further more

#

I've just tried it again with this "Sprite-specialized" code

#

still getting this error

#

I'm trying load a .png file which is set as a "Sprite (2D and UI)" in the settings

orchid crypt
#

I want to make my code clean, so back to my problem. If i have multiple AssetReference, then how can i load them in one task?
I see that there is Addressables.LoadAssetsAsync, but many of them are marked as obsolete. And i need some IList<IResourceLocation> and i see Addressables.LoadResourceLocationsAsync which is obsolete as well. So is there a NOT obsolete solution to batch asset reference loading or any other way to load bundles in addressables?

shrewd geyser
#

Have you checked the overloads that aren't obsolete?
And in what way is the solution we provided yesterday not working or sufficiently clean?

rigid shadow
#

I give up. Not a single person here can explain to me how I can load a batch of Sprites XD

shrewd geyser
rigid shadow
#

Thank you for reading my message, holy hell!

#

I don't think loading sprites marked by labels should be an issue

shrewd geyser
# rigid shadow

Checking this though, you seem to try and load the PNG file... AFAIK, that isn't a Sprite asset, that's just the raw Texture file...?

rigid shadow
#

Oh...

shrewd geyser
#

Perhaps I'm wrong about that.

rigid shadow
#

That could be it?

#

So I could try with Texture2D type

#

or just Texture?

shrewd geyser
#

Well, I'm not sure, I'm waiting for a build to complete to see if I can determine what the internal structure of a sprite versus texture is :p

rigid shadow
#

oh man...

#

I just tried

#

and it works

#

Okay, I just need ONE MORE THING to work, which is how to load .yaml files

#

internally I think it's represented as a TextAsset type

shrewd geyser
#

Are .yaml files considered TextAssets by default? I don't think they are... I was searching for that yesterday to add them to the list of recognized text assets, but I don't think it is.
Unity uses yaml internally, but they do so under different extensions, and not under the yaml extension.

rigid shadow
#
foreach (var baseTileType in Resources.LoadAll(Settings.BASE_TILES_PATH, typeof(TextAsset)))
        {
            var baseTile = Deserializer.Deserialize<BaseTile.Initializer>(((TextAsset) baseTileType).text);
            BaseTileInstances.Add(baseTile.Name, baseTile.CreateInstance());
        }
#

this is how I deserialize a .yaml file

#

I'm using YamlDotNet from nuget

#

so it seems to be a regular TextAsset

shrewd geyser
#

Hmmm. Perhaps this is another Addressables oddity of which file types it can pick up in the whole system

rigid shadow
#

what's confusing me is why didn't it work before when I used the generic T where T : Object

#

Texture2D is also probably an Object

#

should've worked

#

apparently Texture2D inherits from Texture and it inherits from Object

#

I wonder if that's why it didn't work xd

rigid shadow
#

nevermind

#

it works

#

I forgot to change the label

#

Either way, thank you for taking the time to help me solve this!

shrewd geyser
rigid shadow
#

So to summarize

#

The generic T parameter works as long as your object directly inherits from Object

#

Because Texture2D inherits from Texture and not Object directly, it seems to throw an error.

shrewd geyser
#

Hmmm, that shouldn't be right. Im loading several things that have longer type chains than just directly inheriting from Object

rigid shadow
#

Not sure how to explain it then

#

Simply doesn't work when I try to load a Texture2D as a generic

shrewd geyser
#

Depends. Is the .png registered as Texture2D when you check it in the Inspector?

rigid shadow
#

Yes, it is

orchid crypt
shrewd geyser
#

@orchid crypt Ok! :)

shrewd geyser
rigid shadow
#

I suppose it sort of works now

#

but it's giving me all kinds of weird behavior

#

it's loading 1 sprite twice for some reason

shrewd geyser
#

@rigid shadow That's perhaps also the reason why it isn't loadable as type of Sprite. When it's a Texture2D in the inspector, then I think there's no Sprite. When you change the mode to 2D and UI, you'll get a sprite asset that you can load.

rigid shadow
#

I assume you mean

#

it doesn't recognize that it's been changed to a sprite, correct?

shrewd geyser
#

That could also be the case. When you add an asset to an Addressables group, it creates some data in the background inside the group, and I'm not sure whether it updates in realtime.

rigid shadow
#

So how I've made it work with all types is just like this:

#

private List<Object> Assets { get; } = new List<Object>();

#

It has to be of Object type explicitly

#

but now I have another problem, it seems like everything is getting loaded twice

#

var locations = await Addressables.LoadResourceLocationsAsync(assetLabel).Task;

#

for each address, this stores 2 values

#

any ideas why that might happen?

shrewd geyser
#

I have no idea on that front, unfortunately :/

orchid crypt
#

I finished with this code. Have no idea why there is no BundleReference or BundleGroupReference which can do the same but just as AssetReference.LoadAssetAsync

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

namespace FantasyTavernManager
{
    [CreateAssetMenu(fileName = "NewAddressablesCollection", menuName = "Addressables/AddressablesCollection")]
    public class AddressablesCollection : ScriptableObject
    {
        [SerializeField]
        private AssetReferenceGameObject[] assets;

        public async Task<IList<GameObject>> LoadAssetsAsync(Action<GameObject> onElementLoad)
        {
            IEnumerable<object> GetLocations()
            {
                var list = new List<object>();
                foreach(var item in assets)
                    list.Add(item.RuntimeKey);
                return list;
            }
            return await Addressables.LoadAssetsAsync
            (
                await Addressables.LoadResourceLocationsAsync(GetLocations(), Addressables.MergeMode.Union, typeof(GameObject)).Task,
                onElementLoad
            ).Task;
        }
    }
}
using UnityEngine;

namespace FantasyTavernManager.Test
{
    public class AddressablesTest : MonoBehaviour
    {
        [SerializeField]
        private AddressablesCollection addressablesCollection;

        private async void Start()
        {
            var result = await addressablesCollection.LoadAssetsAsync((GameObject go) => { Debug.Log($"{go.name} has been loaded"); });

            var loadingReport = "loading completed: ";
            foreach(var item in result)
                loadingReport += $" {item.name},";
            Debug.Log(loadingReport);
        }
    }
}
rigid shadow
#

What's the point of having multiple groups?

#

Can multiple groups share a similar label? What's the most common usecase to seperate stuff in different groups?

lunar shard
#

I'm not an expert, but I think it's so you can have different bundle strategies. You can tell the Addressable system to have 1 bundle per Group, for example.

#

I've noticed the Addressable's C# code uses a special syntax for certain strings such as {UnityEngine.AddressableAssets.Addressables.RuntimePath}

Am I able to also take advantage of that in my code when I call, for example, the LoadContentCatalog method?

lunar shard
rigid shadow
#

Thank you

wanton pewter
#

i have french and spanish versions of a mobile project with french and spanish specific assets that are addressables. is there any way i can build a spanish edition of my project without including the french assets? I don't want each build to have spanish & french if they only need one or the other

#

or point me to a guide that tells me how to do so? i've been stuck on this problem for about a week

orchid crypt
#

Is there a way to store AssetReference in blittable data? I mean to restore AssetReference from some blittable data in build. I see only AssetGUID which is string

low halo
#

Otherwise turn it into two longs. It's basically just a 16 byte integer

rigid shadow
#

Is there any way to perform loading (or any other operations) ONLY on a certain Group?

#

Such as if I had a general asset loading procedure, probably using labels and such, but I could also pass the Group name as a parameter

#

is that how it works?

shrewd geyser
rigid shadow
#

I see, thank you!

lunar shard
orchid crypt
shrewd geyser
#

They should be, since they refer to the actual asset used in the project to keep or store the reference. If they'd change, your project would break constantly.

#

And otherwise, the AssetReference struct wouldn't work either when using it in your classes to assign them through the inspector.

orchid crypt
#

What i want is to store AssetReference inside IComponentData (dots ecs component) which fields must be blittable data. It is possible to use Untiy.Collections.FixedString/32/64/etc.
But i have faced today a new trouble. I use label to load group of assets and then i want to store loaded asset GUID, but i use IResourceLocation and see no way to get AssetGUID through it.

Here is my code.

public async Task<IList<GameObject>> LoadAssetsAsync(Action<GameObject> onElementLoad)
{
  return await Addressables.LoadAssetsAsync
  (
    await Addressables.LoadResourceLocationsAsync(label.RuntimeKey, typeof(GameObject)).Task,
    onElementLoad
  ).Task;
}

So i want to extract AssetGUID from every IResourceLocation which was gotten from Addressables.LoadResourceLocationsAsync(label.RuntimeKey, typeof(GameObject)).Task

#

I can use SO to store AssetReference array and extract AssetGUID from asset references. But having just AssetReferenceLabel field instead of custom SO is much more compact

orchid crypt
#

I have seen 2 threads with dramatic truth about impossible to do it in a simple way

wanton pewter
#

@lunar shard thank you for your response! i've played around with groups a little bit, but i'm not very comfortable with them because there's so many settings (packed assets? no schema? build path, load path, unique provider, asset bundle crc, chunked transfer, bundle mode, bundle naming, asset provider... omg!). even if i do group them, won't both localized files be included in the build anyways? how do i determine which assets i'll build if i use the default script? sorry if this is dragging on, but this has been giving me a headache for a long time. i've tried using this documentation for content catalogs & groups, but it's too vague for me (https://docs.unity3d.com/Packages/com.unity.addressables@1.8/manual/AddressableAssetsGettingStarted.html). if you're not sure of the answer, do you have any other documentation recommendations i can look at?

cedar jungle
#

I'm trying to use Addressable with WebGL and Unity Cloud Build.
It is configured to build them as part of the cloud build. The build succeeds normally.

But when I call
List<AssetDefinition> definitions = Addressables.LoadAssetsAsync<AssetDefinition>(DEFINITIONS_KEY, null).WaitForCompletion().ToList();

It freezes infinitely with no errors or output. This same line works on other platforms correctly.

(I know I could get past the infinite freeze by not waiting on them with WaitForCompletion, but either way, it never finishes, nor outputs any messages)

Has anyone gotten addressables to work with WebGL? What about WebGL and Unity cloud build?

(Unity 2020.3.4f1, Addressables v1.18.9)

shrewd geyser
#

Sorry man, no experience with either of them. :/

lunar shard
# wanton pewter <@!250709369073696769> thank you for your response! i've played around with grou...

No doubt. I'm actually somewhat new to the whole Addressable system myself, but have a good amount of experience with Asset Bundles (which is what Addressables are underneath the hood, ultimately).

When you mark an Asset as Addressable, it puts it into the default Group. You can then open the Group window and manually drag that Addressable into a new group. In that way, you can make sure each group only contains French or Spanish assets.

If you haven't gone through this yet, I highly recommend it. https://learn.unity.com/project/getting-started-with-addressables

I'd also suggest going to https://learn.unity.com and searching for Addressables in their search bar.

#

I find the whole Addressable system to be pretty intimidating as well, and have many years of Unity experience under my belt, so that's natural.

void thunder
#

If there are multiple prefabs in an addressable bundle which reference the same texture, the addressable system seems to cache the texture while one of the prefabs is loaded, making the loading time for the other prefab take less. I'm currently using this to reduce the loading time of my prefab (which is loaded on-demand during a loading screen) by asynchronously loading a separate prefab (which only contains spriterenderers with sprites assigned) during the main menu scene. This seems to work pretty well and it reduces the load times by a lot. Now, for people familiar with the addressable system, do you know if loading a single sprite from a texture is enough to load and cache the entire texture? I've attempted both loading a single sprite from the texture and loading all of them, but the result seem inconsistent and all over the place.

nimble plaza
#

Has anyone had issues with addressables and textmeshpro? Everything works fine in Editor but both in android and IOS builds there's an issue of texts being invisible. If we're instantiating a prefab that was loaded with Addressables, any TMP_Text(UI) component that's inside the prefab will be invisible. If the prefab with TMP components is being instantiated by direct reference or is simply included in the scene, then it works fine. I've tried to debug this with Rider and stumbled across something weird. For some components, the color field of the TMP component appears as (0,0,0,0), which explains why its invisible as there are no shader errors. However, while debugging, some of the text fields suddenly start working. I'm guessing that TMP is trying to load some things in the background but the code execution doesn't wait for its results. Since debugging slows this down, things start working more properly.

#

I've tried searching online but found nothing

cedar loom
#

Has anyone got invalid key exception ? and know how I can debug this?

cedar loom
#

Ok so it turns out, some how when packing

#

the addressibles

#

they get corrupt lol

#

I reverted to an older commit with addressibles folder moved it in and it worked

#

so something is going on with the addressibles package over time that causes a corruption

#

this is a bit concerning lol

#

doing a diff on the folder now

cedar loom
#

Okay guys, does anyone know of the most stable version of addressibles ? And the editor version you must have to keep it stable ?

shrewd geyser
#

I previously ran with version 1.13.1 for a long time and currently am using 1.17.17 in Unity 2018.4.34 (pretty outdated by now). These 2 addressables version seem to be the most stable ones in a long while (as we've been using these without issues while any other in-between version had issues in our project). Although not sure about the current 1.18.9 version, since it's been a while since an update has been posted. Perhaps it is considered stable enough that no new updates have appeared?

#

But I also guess it depends on what features of the package you're using. I don't have any sprite atlases, or remote content stashed etc. So there might be issues hidden somewhere in there that might pop up in your use-cases.

grizzled gull
#

so in my game I added the GameJolt API, but in another script for the gameplay, for connect the API with the gameplay, I need to put using GameJolt.API, but it doesn't work, it says something like this: "(Is a using directive or assembly reference missing?)"

And this is the image

cedar loom
mossy spruce
cedar loom
# shrewd geyser I previously ran with version 1.13.1 for a long time and currently am using 1.17...

tried your version ran into an issue lol, this seems really buggy, all I want to do is load a game object why is this so inconsistent ...

BuildPath for group 'Default Local Group' is set to the dynamic-lookup version of StreamingAssets, but LoadPath is not. 
BuildPath: '[UnityEngine.AddressableAssets.Addressables.BuildPath]/[BuildTarget]'
LoadPath: '{UnityEngine.Application.persistentDataPath}/WEAssets/Wardrobe/PonyTailsHairGreen'

what do this even mean this worked before

#

no wonder barely anyone uses this system

shrewd geyser
cedar loom
#

and reading various articles around the internet

#
So what are Build Path and Load Path?

LocalBuildPath: [UnityEngine.Application.dataPath]/Exported
LocalLoadPath: {UnityEngine.Application.dataPath}/Resources/Mods
What does that mean? LocalBuildPath is where Unity will export the mod. Look at the folders in the Project window and you’ll see an empty Exported folder. The mod will build to this folder. UnityEngine.Application.dataPath points to the Assets folder of the Unity project.

@shrewd geyser

shrewd geyser
#

Well, I know there's check in place that compares the build and load path at build-time, but from my point of view, it's not something that would work anyway.
When you say that it should build them at [UnityEngine.AddressableAssets.Addressables.BuildPath]/[BuildTarget], then that means it will store them in your Library folder somewhere during build time. This is the default build location. The content catalog file that gets generated for these files will assume that your content will live inside the player build, since it will copy them over to the player when wrapping up the build.
When you say next that your load path is {UnityEngine.Application.persistentDataPath}/WEAssets/Wardrobe/PonyTailsHairGreen, they don't correspond to the paths generated in the content catalog file (you define your load path to be from an external path - the persistent data path in this case. And it may work in theory, but in this case, only by coincidence, I think). So Addressables does a check for what it builds to the default path, should also be loadable from the default path.
In case you can, I recommend reverting these values to their defaults:

[UnityEngine.AddressableAssets.Addressables.BuildPath]/[BuildTarget]
{UnityEngine.AddressableAssets.Addressables.RuntimePath}/[BuildTarget]

cedar loom
#

@shrewd geyser I am trying to load this remotely, so the expectation is, where it should build wouldn't matter?
Prior in 1.15
I would use the exported folder to output to a build path, it provides to be a catalog and hash and a bundle

Then
{UnityEngine.Application.persistentDataPath}/WEAssets/Wardrobe/PonyTailsHairGreen

I would take the files and put them in this folder and have them loaded a run time in the game

#

it would work like 80% of the time

#

sometimes I would get a dependency error

#

or a key error

#

this allowed my app to have DLC

shrewd geyser
#

Well, where it builds them does matter, especially when it's the default build location.
When you say a remote location (but I assume in this case for testing just a local folder somewhere on your system, right?), then both the build and load path should point to that location. If you leave the build path to the default location, it will assume the load path to be there as well, and in this case throws the error you're seeing. So I'd set the RemoteBuildPath and RemoteLoadPath to correspond with each other in the Profile, or... You can set a custom build/load path in each of the Addressables group that should be loaded from the {UnityEngine.Application.persistentDataPath}/WEAssets/Wardrobe/PonyTailsHairGreen location, and leave the Profile values to their defaults.

cedar loom
#

@shrewd geyser I am confused, why would the build path matter? other than to retrieve the files? to be used as content at run time down the line?
I figure load path is the only thing that matters here.

shrewd geyser
#

Right, I'm checking out the tutorial you linked and how he fixes the support for modding.
What's your current build path?

cedar loom
#

pretty much the same build path he has @shrewd geyser

#

for local*

mild flax
#

So unless I'm wrong (this confused the hell out of me for a while, apologies if you already got this) - where your bundle is ultimately downloaded from is actually the remote load path. No idea why you'd expect to know that ahead of time. In addition, I think in 1.17 or 1.18, there seems to be a bug where the Remote load path is basically ignored. Hugely confusing things.

cedar loom
#

My expectation is, as long as I have a bundle, hash and catalog file. I should be able to load the bundle at runtime and then load the key. It should be as simple as that.....

cedar loom
shrewd geyser
# cedar loom My expectation is, as long as I have a bundle, hash and catalog file. I should b...

That's a reasonable expectation, but not one Addressables accepts when building. This is the check Addressables perform during build, and why you get to see the message:

bool buildLocal = buildPath.Contains("[UnityEngine.AddressableAssets.Addressables.BuildPath]");
bool loadLocal = loadPath.Contains("{UnityEngine.AddressableAssets.Addressables.RuntimePath}");

if (buildLocal && !loadLocal)
{
    message = "BuildPath for group '" + assetGroup.Name + "' is set to the dynamic-lookup version of StreamingAssets, but LoadPath is not. \n";
}
else if (!buildLocal && loadLocal)
{
    message = "LoadPath for group " + assetGroup.Name + " is set to the dynamic-lookup version of StreamingAssets, but BuildPath is not. These paths must both use the dynamic-lookup, or both not use it. \n";
}

So when you say pretty much the same build path he has, it's not, because in your earlier message, in your load path, you have {UnityEngine.Application.persistentDataPath}, which doesn't correspond to the load path's value because you use the default. (I'm not making the rules on this one 😅 )

mild flax
cedar loom
cedar loom
shrewd geyser
#

Warning though: complex stuff to view at and plow through imo 😅

mild flax
# cedar loom I don't understand, why this is that complicated it's like they didn't even ask ...

My guess is that most of the issues have their reasons. It isn't a straight-forward problem because addressables cares a lot about dependencies and versions. So it can't be as simple as bundle + hash. That said, the bugs, lack of docs, mess of an api and much more though make the whole thing a total nightmare imo. We've got something working but it feels very much in-spite of, rather than thanks-to. You'll also probably be hit by path lengths at some point - put your build nested a couple of folders deeper and notice everything break.

shrewd geyser
#

We've got something working but it feels very much in-spite of, rather than thanks-to

I concur 😅

cedar loom
# shrewd geyser

So from what I understand there are two settings, one for the group and one for the whole folder (Addressible Asset Settings).
The one for the whole folder has all these extra options such as buid remote catalog, and the two build and load pathes we discussed

#

The lets say we have the Default Local Group
It has a build and load path

#

What is the difference between those two sets of build and load pathes?

#

Another question what does
{UnityEngine.AddressableAssets.Addressables.RuntimePath} convert to at the end of the day?

shrewd geyser
#

The load and build paths on the group are essentially overrides specifically for the assets defined in that group compared to those defined in the settings.
But I shouldn't have suggested that as I think it make your situation more complicated than it probably already is.

cedar loom
shrewd geyser
# cedar loom So from what I understand what you are saying here... is my use case is no longe...

Well, it is (I think), but only with properly defining of build and load paths. Just pick a different build location other than having it in the default location:

BuildPath: 'Path/to/somewhere/on/your/system/Export'
LoadPath: '{UnityEngine.Application.persistentDataPath}/WEAssets/Wardrobe/PonyTailsHairGreen'
After the build is done, you can copy these file from the build path, past them in the persistent path location you use for testing.

cedar loom
#

but sometimes it bundle's it correctly :S

shrewd geyser
#

Is it possible to show this dependency failure message you get? (I mean the full message and exception stack)

cedar loom
#

yep one second

cedar loom
shrewd geyser
#

No problem :)
Tag me when you have it, I'll check it out as soon as I can

cedar loom
#

@shrewd geyser

OperationException : Dependency operation failed with System.Exception: Unable to load asset of type UnityEngine.GameObject from location PonyTailsGreen-Hair..

UnityEngine.ResourceManagement.AsyncOperations.AsyncOperationBase`1/<>c__DisplayClass57_0<UnityEngine.GameObject>:<add_CompletedTypeless>b__0 (UnityEngine.ResourceManagement.AsyncOperations.AsyncOperationHandle`1<UnityEngine.GameObject>)
DelegateList`1<UnityEngine.ResourceManagement.AsyncOperations.AsyncOperationHandle`1<UnityEngine.GameObject>>:Invoke (UnityEngine.ResourceManagement.AsyncOperations.AsyncOperationHandle`1<UnityEngine.GameObject>) (at Library/PackageCache/com.unity.addressables@1.18.11/Runtime/ResourceManager/Util/DelegateList.cs:69)
UnityEngine.ResourceManagement.ResourceManager:Update (single)
MonoBehaviourCallbackHooks:Update () (at Library/PackageCache/com.unity.addressables@1.18.11/Runtime/ResourceManager/Util/MonoBehaviourCallbackHooks.cs:26)


shrewd geyser
#

And there isn't any error or exception happening before that?

#

(Related to Addressables at least)

cedar loom
#

@shrewd geyser none sadly only this

Exception encountered in operation Resource<GameObject>(PonyTailsGreen-Hair), status=Failed, result= : Unable to load asset of type UnityEngine.GameObject from location PonyTailsGreen-Hair.
UnityEngine.AsyncOperation:InvokeCompletionEvent ()
#

sadly now the lighting in my project is borked lol

shrewd geyser
#

And the PonyTailsGreen-Hair bundle is available at the expected location?
Could you perhaps share the content catalog file?

cedar loom
#

yeah for sure ill share it

#

this should be the lookup key "PonyTailsGreen-Hair" @shrewd geyser

shrewd geyser
#

Thanks, I'll check it out in a minute.

cedar loom
lunar shard
#

Hey all, I have a question about what version of the Addressables package is the version that's considered "stable".

1.16.19 is listed as "verified", and then there is a huge group of preview version in the version 1.17 group, but above that is some more of the 1.17 group and then the 1.18 group that is not listed as preview.

So is 1.16.19 the stable version and anything after it is unstable? Or is 1.18 officially recommended for use by Unity, or what?

cedar loom
#

it works, but the packaging aspect of the bundles for my specific use case does not

mild flax
#

I suggest going through the change logs and seeing what issues are important to you. I think all of the latest versions have critical fixes so we're using the latest. Doesn't mean it's stable.

shrewd geyser
#

@cedar loom
So you have copied over the files etc. to {UnityEngine.Application.persistentDataPath}/WEAssets/Hair/LongTwintailsGreen/, right?
Are you testing in editor, or in a player build?

#

And can you share how you try to load that asset? Is it through an asset reference? Or Do you call something like Addressables.LoadAssetAsync<GameObject>("PonyTailsGreen-Hair")?

cedar loom
#

both fail

cedar loom
#

@shrewd geyser

  public void Instantiate(string key,
                            string attachPoint,
                            Vector3 position,
                            Quaternion rotation,
                            Transform parent,
                            Action<GameObject> assetCallBack)
    {

        //InstantiationParameters instParams = new InstantiationParameters(position, rotation, parent);
        //AsyncOperationHandle<GameObject> handle = Addressables.InstantiateAsync(key, instParams, true);
        AsyncOperationHandle<GameObject> handle = Addressables.InstantiateAsync(key, trackHandle: true);
        didFinishLoadingAsset += assetCallBack;
        handle.Completed += OnLoadDone;
        attachPointForAddressibleKey[attachPoint] = handle;
    }
shrewd geyser
#

and I guess the key that gets used is PonyTailsGreen-Hair?

cedar loom
#

yep!

shrewd geyser
#

I'm wondering whether the key is the problem... Since in your content catalog, the key PonyTailsGreen-Hair isn't present on its own. It has a whole bunch of other things before it:
Assets/Models/BaseModel/BaseModelHair/PonyTailsHair/PonyTailsGreen-Hair.prefab

cedar loom
shrewd geyser
#

Could you either try with the full address, or simplify the address and try again? (after a rebuild, I guess, since the catalog file still contaisn the old, longer key then)

shrewd geyser
cedar loom
#
    "{UnityEngine.Application.persistentDataPath}/WEAssets/Hair/ShortHairGreen/shorthairgreen_assets_all_dd412fe1ac5adeb61a9a45f9dd66e5ea.bundle",
    "Assets/Models/BaseModel/BaseModelHair/ShortHair/ShortHairGreen-Hair.prefab"

this is what is in the working one

#

doesn't seem to contain the key in plain text in the catalog.json

#

hmmm

#

whats odd is comparing them

#

I am gonna check that key's string

#

it's base 64 decoded

shrewd geyser
#

So you have working mods that have been build and tested in the same way? And is it just one? Or multiple that you have working?

cedar loom
#

I have like 80% of them working haha

#

theres like 20% where when I build it

#

it works

#

then its fine

#

then I think oh if I follow the same process it will work for the remaining 19%

#

I follow the same process

#

and the remaining 19% fail

#

so its driving me instane

#

Funny story, when I first started using unity, I had thought, that unity crashes on null exceptions and used it like that for 7 months

#

it turns out, it was a unity bug

#

so this is another unity break or make it story for me

#

@shrewd geyser maybe I should write a unity forums post on this maybe it will be helpful to other people

shrewd geyser
#

Hmm... If they are all set up in the same way, and some work while other don't, then I'm not very sure where to look at :/
Since it seems alright from the files, and if you do the same for each one, then I wouldn't know why some fail, while others wouldn't.

shrewd geyser
#

Hmm, could be, though I haven't used 'remote' assets, so I haven't used the cache

#

So no experience on my end for any advice or pointers.

cedar loom
#

I am gonna do a compare

shrewd geyser
#

I checked out the decode base 64 of the data inside the catalog, and it does contain the previously mentioned key... So I guess that one's ok.

cedar loom
#

@shrewd geyser thanks for your help so far, it means a lot just to even clarify if I am on the right track of thinking

shrewd geyser
#

It sounds like you're the right track indeed. But I do suggest to also make a forum post as you mentioned earlier. Some other people with the same goals might probably jump in over there.

orchid crypt
#

Honestly, just a simple idea "to load asset in editor script", and after that idea came up to my head i have found myself reading this post and asking myself will i have to learn something else then unity soon 😕
https://forum.unity.com/threads/how-to-use-addressable-system-in-editor-script.715163/

velvet wagon
#

Damn theres an addressables channel now? awesome

cedar loom
cedar loom
#

@mild flax hey do you know if we can just walk through the addressable code? is it open source? I didn't really check just yet possibly a stupid question right here haha

frank panther
#

It's a package. AFAIK we can view the code of any package

cedar loom
#

@frank panther kk thanks! sorry not a native c# person

shrewd geyser
#

@cedar loom You can. Like I showed in the screenshot, you can open the scripts through that already. However, when using the 'Go To Definition' utility in VSCode, it will open up the assembly information rather than the script.
Most likely, you've downloaded the package through the package manager. That way, it will keep the actual code 'hidden' from your code editor. What you can do (and what I did in our project), is to move the Addressables package in your project. By default, packages are stored in the Library/PackageCache folder. When you cut&paste the com.unity.addressables@xyz folder (with xyz being the version number of the package) to the Packages folder (lives next to the Library folder), it will open up scripts just fine. :)

mild flax
cedar loom
cedar loom
lunar shard
#

Does the Reference Count management system system that Addressables has only work if you use the InstantiateAsync method?

I'm a bit confused by the documentation.

#

and by work, I mean, work on its own without my involvement in interacting with handling counting stuff myself

placid iris
#

Anyone had some luck with Editor Hosting?

undone hound
#

not yet - attempting to get it working

#

struggling

sturdy mason
#

hey, I'm having some issues with addressables

#

this is the view in my game

#

then I try and build for android and al the addressables won't show up

#

This is the in game view

#

Ignore the weird shading I'll have to fix that separately

#

But the robot and all it's parts won't show up

sturdy mason
#

nevermind all that

#

it's related to somethingelse I found out

rigid shadow
#

has anyone found that loading defs is really, really slow?

#

as in, when I try to load lots of assets asynchronously, when I await them in a foreach loop and debug.log them, they log out really really slowly

#

almost like they're capped somehow

low halo
rigid shadow
low halo
#

Get all the tasks first

#

put the tasks in a list

#

then await those? 🤔

rigid shadow
#

Could you please give me a concrete code example?

#

Addressables confuse the heck out of me

#

I barely managed to scrape this together

low halo
#

get all the tasks in a list, then call await Task.WhenAll(listOfTasks);

rigid shadow
#

at what point after calling that do I add the loaded sprites to my dictionary?

#
public static async Task InitSprites(string assetLabel)
    {
        var locations = await Addressables.LoadResourceLocationsAsync(assetLabel, typeof(Sprite)).Task;

        List<AsyncOperationHandle<Sprite>> tasks = new List<AsyncOperationHandle<Sprite>>();

        foreach (var location in locations)
        {
            tasks.Add(Addressables.LoadAssetAsync<Sprite>(location));
        }

        foreach (var task in tasks)
        {
            Sprite sprite = await task.Task;
            Debug.Log($"LOADED IMAGE");
            AllSprites.Add(sprite.name, sprite);
        }
    }
#

@low halo is something like this not correct?

low halo
rigid shadow
#

List<Task<Sprite>> tasks = new List<Task<Sprite>>();

#

I've got this list

#

but can't figure out how to add Tasks in it

low halo
#

you are doing that right

rigid shadow
#
var locations = await Addressables.LoadResourceLocationsAsync(assetLabel, typeof(Sprite)).Task;
        
        List<Task<Sprite>> tasks = new List<Task<Sprite>>();
        
        foreach (var location in locations)
        {
            tasks.Add(location);
        }

        var test = await Task.WhenAll(tasks);

        foreach (var thing in test)
        {
            AllSprites.Add(thing.name, thing);
        }
#

This is what I've got

#

just can't figure out where to get the tasks that I need to add

low halo
#

that doesn't work?

rigid shadow
#

no

low halo
#
tasks.Add(Addressables.LoadAssetAsync<Sprite>(location).Task);```
rigid shadow
#

oh

low halo
#

then

        var test = await Task.WhenAll(tasks);

        foreach (var thing in test)
        {
            AllSprites.Add(thing.name, thing);
        }```
rigid shadow
#

I messed something up...

rigid shadow
low halo
rigid shadow
#

well

#

the documentation for addressables is abysmal

rigid shadow
#

Does anyone know how to clear Addressables cache?

#

Similar to how you can use AssetDatabase.Refresh() in the old system.

#

I am trying to re-load definitions at runtime (I read my information from YAML files, so I want to change then when the game is running, and reload with the new information)

#
Addressables.ClearDependencyCacheAsync(allLocations);
Caching.ClearCache();
#

I've tried these two options but none of them seem to work

rigid shadow
#

Also, is there any way to change the folder name from "Resources_moved" to anything else a bit more coherent?

copper lichen
#

I've just had a bit of a surprise. AssetReference is a reference type and also has no hash support or equality operator. Does anyone else find this surprising?

jovial basalt
#

hi guys! I don't have much experience with Addressables and I know that I might be looking at it on the side that it wasn't designed for, but - is it possible to get the address of an asset from its instance? for example - i've got a SO which is addressable. I've got instance of it (in memory). How one would try to obtain address of this asset in this situation?

cedar jungle
#

Has anyone gotten addressables working with WebGL? It fails to load for me and gives me no information whatsoever.

shrewd geyser
shrewd geyser
short folio
#

Hi guys, sorry Im new to addressable, lets say I have set one of my scene to be addressable and I make some change to one of the script that used in the scene, do I have to re-built the addressable data?

shrewd geyser
#

Depends on the changes of the script. If it's pure the logic of functioning that has changed, but nothing related to data that is serielized, e.g. you didn't add a field that needs to assigned through the inspector or something, then you don't need to rebuild.
If it does have a such a change, it will need a rebuild.

short folio
undone hound
#

I'm getting two really useful console errors when I try to build addressables. Nothing is coming up in my google searches, wondering/hoping someone else has come across these and knows what's going on

path
UnityEditor.GenericMenu:CatchMenu (object,string[],int)```

Addressable content build failure (duration : 0:00:00)
UnityEditor.GenericMenu:CatchMenu (object,string[],int)```

kind relic
#

If you use LoadSceneAsync, then activate the Scene. then swap to an other scene, and you want to come back to your Addressable Scene... Is there a way to do it?
If I do LoadSceneAsync again, it will fail saying it's loaded, if I try ActivateScene, will tell me scene already loaded

rigid shadow
#

Does anyone know how to clear Addressables cache?
Also, is there any way to change the folder name from "Resources_moved" to anything else a bit more coherent?

cedar jungle
#
System.IO.DirectoryInfo.CheckPath (System.String path) (at <695d1cc93cca45069c528c15c9fdd749>:0)
System.IO.DirectoryInfo..ctor (System.String path, System.Boolean simpleOriginalPath) (at <695d1cc93cca45069c528c15c9fdd749>:0)
(wrapper remoting-invoke-with-check) System.IO.DirectoryInfo..ctor(string,bool)
System.IO.Directory.CreateDirectoriesInternal (System.String path) (at <695d1cc93cca45069c528c15c9fdd749>:0)
System.IO.Directory.CreateDirectory (System.String path) (at <695d1cc93cca45069c528c15c9fdd749>:0)
UnityEditor.AddressableAssets.Build.DataBuilders.BuildScriptPackedMode.MoveFileToDestinationWithTimestampIfDifferent (System.String srcPath, System.String destPath, UnityEditor.Build.Pipeline.Interfaces.IBuildLogger log) (at Library/PackageCache/com.unity.addressables@1.18.9/Editor/Build/DataBuilders/BuildScriptPackedMode.cs:938)```

I get this error when attempting to build addressables with the RemoteLoadPath set to a web address.

Maybe I am using the remote load path wrong? I thought it was supposed to be the eventual path where I will upload the addressable content? Idk why it would try to build there. Shouldnt it build to the remote build path? not build to the load path?
shrewd geyser
#

And what cache do you need cleared? The runtime cache? Or the build cache?

rigid shadow
#

uhh

#

the runtime cache

#

I asked a question here a while ago

#

but no one seems to know

kind relic
#

There is two method to clear cache but neither work with latest version I use

#
if (Directory.Exists(Caching.defaultCache.path))
  Directory.Delete(Caching.defaultCache.path, true);
shrewd geyser
#

Yeah, seems like there are a few issues with clearing cache. Never had to use it because I use local bundles only.

kind relic
#

Method that should work is either Caching.ClearCache() or Addressables.ClearDependencyCacheAsync

shrewd geyser
rigid shadow
kind relic
#

So use the direct method like I do

#
if (Directory.Exists(Caching.defaultCache.path))
  Directory.Delete(Caching.defaultCache.path, true);```
rigid shadow
#

oh

#

I misread as that not working

#

I'll give it a shot now

kind relic
#

the "unity" method use to work in previous version but not anymore... the DIrectory.Delete does work, you just need to make sure it's execute before you call anything about addressables

shrewd geyser
cedar jungle
kind relic
#

lol yes you need Alebasco... it's really fun 🙂

#

Once your build script is setup, it goes well, but it's a pain

shrewd geyser
cedar jungle
shrewd geyser
#

Right, so the default value of the profile?

rigid shadow
#

What is the default cache path on windows?

kind relic
#

Do a watch in debug for Caching.defaultCache.path

cedar jungle
#

This is my setup. I thought it would build to the build path, and only use the load path when.. loading?

kind relic
#

or give me a minute

#

as said, it won't work if you have initialized Addressables

#

C:/Users/----/AppData/LocalLow/Unity/YOURGAMEBUILDNAME

rigid shadow
kind relic
#

in your game, as soon as you do a command about Addressables, like DownloadContent, it is initialized

rigid shadow
#

I load them like so

#

Do I need to release anything to uninitialize them?

#

or how does it work

kind relic
#

when you do LoadAssetAync

#

you need to clear the cache BEFORE, after is possible, but would need to look in addressable code and it's a total mess

shrewd geyser
kind relic
#

I did once to find out why the % downloaded was not working, and I will try to avoid

rigid shadow
#

Wait hold on

#

this should work in the editor, right?

kind relic
#

when you run your game yes...

#

do you need to do it often, or you want to do it once?

rigid shadow
#

Not often, I only use it for development purposes

#

I load all of my data from YAML files

kind relic
#

then you can delete manually

rigid shadow
#

I can change stuff in yaml, and while the game is running, I want to delete the cache and load all the stuff again with the new values

kind relic
#

then run that command as the first thing to run in your game... or before any addressable command and it should work

rigid shadow
#

I can't find my game at that directory

#

Looks like it never creates the cache here, hence why I cant delete it

#

Where else could it be?

kind relic
#

Which version of Unity and addressable?

#

do you know how to debug?

rigid shadow
#

Unity 2020 and addressables 1.16.19

#

yes, I've debugged and looked at that "Caching.defaultCache.path"

#

it points here

#

and there's nothing here

kind relic
#

appdata\locallow\YOURNAMEGAME does it exist?

rigid shadow
#

yes, but before the game name it's company name

cedar jungle
rigid shadow
#

locallow\company\gamename

#

these are the settings in the adressables object

#

anything to do with this, perhaps?

kind relic
#

that's ok, what's there?

#

if you work locally BTW there is no cache

#

under that ocallow\company\gamename do you see a folder that look like a GUID?

rigid shadow
#

no, nothing

rigid shadow
#

How can it be so complicated to find a cache xD

#

gg unity

shrewd geyser
#

@cedar jungle
Hmmm, I'm running 1.17.1, and I see that some functions don't have the same name anymore, so they definitely changed some things up in there between then and your version (1.18.9), so perhaps this is a regression issue, because on my end they use the Schema's buildpath, or so it says in the code... Perhaps this value is overridden somewhere else that it becomes the load path...

var path = schema.BuildPath.GetValue(assetGroup.Settings);
...
var targetPath = Path.Combine(path, outputBundles[i]);
kind relic
#

you have no cache if you are local

rigid shadow
#

uhh

#

how would I achieve what I need then?

#

am I even using the correct terminology?

#

I need to clear whatever data is saved when loading by address at runtime

kind relic
#

Do you plan to distribute your data by addressable?

#

is your editor setup to use cache data?

rigid shadow
#

I'm not sure...

kind relic
#

what is your playmode?

#

that's under addressable/group

rigid shadow
#

the first one

#

what are the differences?

kind relic
#

Then you are local and using no cache...

#

the 3rd one simulate a real client...

rigid shadow
#

god damn it HAHAH

#

I never saw any documentation for this

kind relic
#

the 1st one just bypass all addressable configuration and use the asset like a resource folder (or close to)

#

Documentation is not addressable forte

rigid shadow
#

definitely...

#

let me give this a shot

kind relic
#

Addressable is a like a pot of boiling oil, and you need to fetch something in it with your bare hand... so you go only if you "REALLY REALLY" need to 🙂

rigid shadow
#

still didn't work...

#

there's still no cache being generated

kind relic
#

ok a little bit extreme but it's how I feel

#

Did you build your addressable?

rigid shadow
rigid shadow
#

this is how I always rebuild

kind relic
#

and file have appear in the proper folder?

rigid shadow
#

not sure what folder I'm looking for

kind relic
#

do you download your addressable?

rigid shadow
#

no

#

everything will always be local

kind relic
#

those one... BUILD path

rigid shadow
#

I can't find that

#

whats the actual path to that

#

where is ServerData

kind relic
#

it's one level before your asset folder

shrewd geyser
#

Next to your Library folder in the project's folder structure

kind relic
#

thank @shrewd geyser 🙂

rigid shadow
#

okay, in there I have this:

#

is this considered the cache?

kind relic
#

nope... that's the build path, and you only have the hash/json, so you are building nothing

rigid shadow
#

I need to make addressables forget everything it's loaded completely, and then do it again from scratch, at runtime

kind relic
#

what is in your data group?

rigid shadow
#

could you please clarify

rigid shadow
#

what do you mean by data group?

#

relatively new to addressables so don't know where to look

kind relic
rigid shadow
#

btw, I really appreciate you trying to help me

kind relic
#

no problem 🙂

rigid shadow
#

Looks like this, pretty standard stuff

kind relic
#

yes

#

so run your build script again and let see

rigid shadow
#

nothing changes when I build, unless I'm missing something

shrewd geyser
kind relic
#

your build script could not be configure properly...

cedar jungle
kind relic
#

missing a \

rigid shadow
kind relic
#

did you follow the step on the addressable doc page? on how to use?

rigid shadow
#

no

#

yikes

cedar jungle
# kind relic missing a \

right, it shouldnt be using this path at all. Its trying to convert a webpath to a local directory..

kind relic
#

ok sorry

#

you should start by that @rigid shadow been I while since I configure mine, and you may be missing something that I don't see

shrewd geyser
rigid shadow
kind relic
#

yes...

cedar jungle
rigid shadow
#

yes, thank you xD

#

didn't find anything useful there

shrewd geyser
cedar jungle
shrewd geyser
#

Yeah, can't offer any help or experience with that one I'm afraid. I'm keeping my games on standalone 😅

cedar jungle
cedar jungle
#

okay, so I have some info on why my WebGL build is not working. It is looking for

StreamingAssets/aa/settings.json

Which doesn't exist. I found the file in the library though, so I could copy it into the project... But can anyone tell me what this file is? (And for bonus points, why it wants it to be in streaming assets, and if there is any way to have the general build process to handle this like I would expect it to?)

undone hound
cedar jungle
pure storm
#

curious if anyone can assist me in setting up a good work flow deploying Addressable bundles through the built in Cloud Build Delivery. As I currently understand it, each time a build completes the content is uploaded to the bucket and old files are removed from the bucket, then a new release is created. Is there a way to ensure that old versions of the app can still see the old files? I want to associate each version of our app with a release of these buckets. Currently I don't see an easy way to do this without doing some custom scripting

#

ideally we could inject the Release ID from the cloud bucket release version back into the RemoteLoad path

mild flax
slate timber
#

Could not load StyleSheets/Extensions/fonts/ınter.uss
I'm getting this message at the start of a project. What should I do?
It started to happen after I switch to visual studio code, I don't know if it relates
I hope I'm asking in the right channel
Edit: After some restarting, it is not shown anymore.

pure storm
#

@mild flax yah my current idea is to set remote load path to a version code badge. After cloud build finished just set this badge when my CI system uploads to the stores

pure storm
#

just update, did what I described above and worked well

steady quiver
#

i've recently entered in this chat, someone must have passed through this, could mention a hint about missing default shaders in android using existing build?

#

oh, got it build scripts are different from editor, so i had to build them to see, android-only

#

hope unity has a work around for calling shaders for editor support

placid iris
#

Anyone has any idea how addressables handles nested prefabs? For example if both a master prefab and its sub children nested prefabs are addressable assets, if I load the master prefab it handles the internal prefabs as part of the master prefab or solves them through addressable assets?

low halo
#

Meshes, textures, audio clips, other prefabs, etc..

halcyon mantle
#

Does anyone know if addressables work on google play or app store

shrewd geyser
halcyon mantle
#

@shrewd geyser thanks! that was very helpful

#

I stumbled into another problem, and when I load addressables scenes, the scripts in the new scene become like this, anyone knows why?

#

And this error is thrown

UnityEngine.GUIUtility:ProcessEvent (int,intptr,bool&) ```
ionic shadow
# steady quiver hope unity has a work around for calling shaders for editor support

There is a workaround for that.
You can change the Graphics api in standalone windows player settings to OpenGLES3 (remove direct11, leave opengles only) and shaders should load as they would on Android. (Yes, settings for windows player affect editor for some reason).
It kinda works for me, but it was crashing on one of the scenes I've got in the project - might be something wrong with one of the custom shaders though

#

(or the graphics api settings for mac/linux, whatever system you're on)

short breach
#

Someone explain to me why taking c sharp that has virtual pointers anyway and going full circle away from them and then reimplemented as another layer of abstraction makes the sense

indigo notch
#

or that you should be releasing handles?

short breach
#

i mean at the highest level for the whole system here

#

its a layer of abstraction into managed code where pointers get virtualized and generally arn't advised where you develope an entire subsystem and abstraction just to get back to pointers again

fresh furnace
#

Sorry for the noob question but I would like to know if my use case fits Addressables:

I want to add modding support to my VR game. For code I can easily design a mod loading system but for assets I have no good idea how to allow third party programmers to load assets at runtime and use them in their code. Is this something that can be solved with Addressables?

#

From modding in RimWorld I got this working myself by using the exact same version of Unity as the original game and exporting asset bundles. It’s cumbersome and unintuitive especially if you want to support multiple platforms. It breaks easily if the game updates its Unity version too.

lunar shard
#

I honestly prefer glTF over assetbundles and desperately want Unity to support gltf without us having to grab 3rd party code

#

The benefits of Assetbundles are things like, being able to do some pre-processing in Unity before exporting the bundle

#

So you can add script references and such to an asset and Unity will hook them back up for you (as long as the script exists in the project)

#

However for 3d assets you can make them significantly smaller using GLTF thanks to tech like draco. And more flexibile thanks to texture tech like BasisU.

#

Unity supports neither inside of asset bundles

balmy hemlock
#

Hey all, I'm looking for some eyes on this scene preloader code that uses Addressables in a WebGL build — I'm getting a bizarre build-crashing error when the download completes and can't figure out what might be causing it. Any and all help appreciated! https://forum.unity.com/threads/webgl-build-crashes-when-addressables-downloaddependenciesasync-reaches-completion.1147703/

lunar shard
#

So if you need to stream lots of stuff over the internet, I really like GLTF for that.

If you don't, assetbundles are fine, but there is a possibility they can break between Unity versions (it is rare) and you have to rebuild them from the base assets using a newer version of Unity.

#

Using a newer version of Unity to make assetbundles for a game build using a lower version of Unity is probably also not good. I have never tried that personally.

@fresh furnace btw

#

Addressables still uses assetbundles underneath its layer of code. So no changes there. All the same limitations still exist.

In theory, if you directed people on how to create catalogs with specific names and how to name their addresses for their assets players could load their own assets that way, yes.

Basically everything in Addressables can be grabbed by string like grabbing something out of a Dictionary, so if your game can support that then you can allow players to control those strings.

fresh furnace
#

That sounds like a nightmare to support. I was one of the users of that myself in RimWorld where I was the first to import asset bundles and I had to match the Unity version exactly to the game.

#

Most modders are coding beginners

#

I want an easy way to code and have some custom assets too. The typical modding scenario

lunar shard
#

See I am surprised to hear it was that sensitive for Rimworld. I have worked with asset bundles in the past and used bundles that were built in pretty old versions of Unity that loaded fine in newer ones.

#

But like you said, they CAN break eventually.

#

And Unity's solution is "rebuild the bundles from scratch"

#

GLTF is potentially easier from a standpoint of asset longevity. But it will require a lot more work for you personally because Unity doesn't support it out of the box.

#

You'd have to extend GLTF's JSON spec to pass in material info if you have complex materials and shaders that can be a pain in the ass.

#

Also your players would need to preprocess textures, turning them into DDS, Crunch, or Basis (if you wanted to use Basis) compression

#

You can make tools to make that easier yourself, of course

fresh furnace
#

We are talking about modders here. You know, those who disassemble dll’s to look at the source code, which normally is partly private, and then make it do stuff that it wasn’t intended to do.

#

If I can at least document how to get assets (like meshes and shaders) into the game and also document how to do stuff in code that you normally would do in the editor, it should be better than nothing.

#

There aren’t many games out there that support bringing assets into the game. I can at least try

#

Make all my code very modular and with lots of public submethods. Maybe use gltf myself and by doing so create some helper code that modders can use too. I’m at the core a low level coder anyway and prefer to do a lot of thing algorithmically anyway instead of having lots of logic invisible in the editor.

#

RimWorld has defs - xml that is deserialized when the game or a mod has such files in it. I hate it and rather create stuff from code. It’s a different mind set.

#

What is missing is the way to get the raw material into the game and have it independent because mod and game have its own lifecycle

lunar shard
#

Yeah, so, there is no other way to get completely new shaders into Unity besides Assetbundles (that I am aware of)

#

If you want to allow custom shaders, you could in theory import them in an Assetbundle first and then after you import your GLTF model, ask all materials to use that freshly imported shader

#

Will that Assetbundle with the shader break in the future? Maybe. But you'll only have to rebuild the bundle or bundles containing the shaders instead of all of your assets.

fresh furnace
#

True. The biggest complain I have is that asset bundles are platform specific. So one has to create 3 files for Mac/Win/Linux and then in the loading code again choose the right one. Not very elegant

lunar shard
#

Yes, that is because of two things. Compiled shaders for that platform, and texture compression formats. Also probably other minor reasons since assetbundles can have all sorts of stuff in them besides just meshes and textures.

#

Basis is supposed to solve the latter, but I haven't experimented with it myself. If you don't need to support arbitrary custom shaders, you can potentially use GLTF+Basis to create textured 3d assets that will work on any platform that supports loading Basis textures at this time.

fresh furnace
#

That sounds promising, thnx!

long escarp
#

Hello.

long escarp
#

I just don't get it that "Addressables" is a replacement of "Asset Bundle"

#

when to choose "Addressables" over "Asset bundle download and caching"

#

Unity is making something awesome but does not make any fujking documentation. So who is gonna use this super feature?

#

Unity developers, please with all my respect, hire someone who can write a DOCUMENTATION. and make some Q&A videos

#

regarding this addressables.

lunar shard
#

Addressables, in my experience, has been a layer that exists ontop of asset bundles to help build and manage them

#

but it is quite complicated to work with

#

there is definitely documentation for them, but I feel like the way people stream assets varies wildly

#

right now I'm running into problems in using Addressables if I'm unsure a catalog will exist on my webhost, for example

#

seems Addressables just throws a bunch of errors that I can't catch myself

buoyant relic
#

LoadResourceLocationsAsync is marked as obsolete.... I can't find any documentation saying what you are supposed to replace it with

#

does anyone know?

ionic shadow
#

Anyone else losing references in scene-objects in addressable scenes?
It seems to be happening at random to me.
Wrapping the entire scene content in a prefab and loading the prefab as addressable works fine, keeping all the references, but why aren't addressable scenes working as they should?

buoyant relic
#

nope, not a problem iv had with it. Though iv had times where i'v updated the scene. Had my build scripts set to 'use existing build' & then because I didn't rebuild the package, it would not be maintained. That's frustrating. Are you sure it's not the scenario your running into?

ionic shadow
#

nope, I found the reproduction steps though

#

When a scene object references a component in a prefab - the reference is gone in a built scene.
If you add a reference to the prefab as a gameobject in the same script - all is well. Seems like a bug to me 🤔 , Imma submit a bug report with that

ionic shadow
#

Seems like Unity made a stealth fix for that - yesterday's version 1.18.15 kinda fixes it - it still doesn't work out of the box, but marking the prefab with the referenced component as addressable fixes it now.
I say it's a "stealth fix" cause they didn't bother to create a changelog for 1.18.14 or 1.18.15 ... C'mon unity

unique beacon
steady quiver
#

Guys! Is anyone having problems loading addressable additive scenes. It keeps loading and there is no other task running alongside

ionic shadow
#

nope, works fine for me - are you getting any errors in the console, or logs saying that some bundle is not found?

steady quiver
#

no, guess must be some configuration maybe, right?

long escarp
#

Hello.

#

I really need to learn this. really appreciated in advance if you help me out!

#

I quit using asset bundles.

#

and want to use "addressable system"

#

my question is : I have 10 book store in my database and all of them have their asset bundles.
in order to download and use one of the book store, I need to specify my "ADDRESSABLE PROFILES" right? because my remote load path is going to download the content

#

I mean should I store my "addressable profiles" in database and download this first and convert it into "scriptible object" and assign it into my "profile"?

#

is that correct?

ionic shadow
#

No, the profile only tells the build where to get the bundles from, you don't change anything with the profile after you built the game

long escarp
ionic shadow
#

Every addressable asset has an address, that's like the whole thing about this system. It's visible in the inspector and in the addressable groups window

long escarp
#

But I will have more than 10.000 book stores and more than 1.000.000 book assets.

#

let me explain with an example.
I launched my application and went to a bookstore. According to my location, the bookstore where I am in will be detected and will start downloading the content (all the book assets) and I will use these book assets in my application. (AR application)

#

So, in addressables, I should write the "remote load path" before I build asset bundles.

#

@ionic shadow

#

but at the same time when I download the content, I like to save them into the local storage and if there is no new version, my application will use the one it has, otherwise it should download the new version of the content

#

what should I do I do notknow

#

maybe the asset bundle system is much more suitable for this?

#

make asset bundles for each "book store" (1000 books in an asset bundle) with their manifest file. Put them into the server. Download the manifest first and find the asset you do not have. download it and cache into the local storage and use... what do you think?

ionic shadow
#

Addressables is a system built on top of asset bundles, it's still working with asset bundles in the end.
You can preload and cache bundles using DownloadDependenciesAsync: https://docs.unity3d.com/Packages/com.unity.addressables@1.18/manual/DownloadDependenciesAsync.html
Bundles are cached automatically in addressables - just like they are in asset bundles when you supply the bundle version hash.

You should IMO have every book store in a separate bundle, and figure out a system to get the correct bundle from a location - something as simple as a naming convention would work, but you could also go with creating a ScriptableObject that holds a Dictionary<StoreLocation, BookStoreBundleAddress>, keep that as addressable and make sure it's always up to date.

But it's a project-specific use case, so there's no built-in solution.

long escarp
#

thanks I should read over it again!

long escarp
#

if I use Addressables.LoadAssetAsync does it cache the asset I call?

#

@ionic shadow

ionic shadow
#

yep

long escarp
#

so, I do not need to use "profile" to retrieve the data.

ionic shadow
#

Tries to get it from cache first, if it's not there- downloads it and caches it

long escarp
#

hmm.

#

thanks 🙂

ionic shadow
#

the profile is basically just settings for the system - so it know where to get bundles from groups marked as "local" and where to get the ones from "remote" groups

long escarp
#

but I have more than 1 remote asset groups (different book stores) how can I change my adressables direction?

#

I have to do that in runtime

#

I took too much time, this is the last 🙂

ionic shadow
#

I'm not sure I follow

#

Do you want to keep those assets in different services with different urls?

long escarp
#

yes because more than 100 bookstore that have more than 1.000 books

long escarp
#

"The content update process creates a new version of the catalog (with the same file name) to overwrite the file at the previously specified load path."

#

My previous content is 10gb and I made a tiny changes on one of my content for 10mb

#

Do I have to overwrite all the 10gb+10mb ?

#

Or is there a smart solution?

ionic shadow
#

I believe using the "update previous build" option rebuilds only the changed groups, and not the entire thing. So unless you keep everything in a single 10GB bundle, you won't be replacing everything, only the changed files.

kind relic
#

@steady quiver are you loading more than one scene? or trying to do other adressable command after loading the scene?

long escarp
#

thanks

silent badger
#

Hey everyone, I'm stuck on something with my addressables and I could use some help. I added some materials to the default group (no label), these materials use a custom shader. I build my app for WebGL and tried to load a material and assign it to a mesh. According to my debug.log the material is found and assigned to the mesh but I get the hidden/InternalErrorShader aka Pink meshes. I've included the custom shaders to the "Always include list" in the graphics settings but that did not help. Any idea what I'm missing? Can someone shed a light on his. It my first time using addressable and I got the feeling I overlooked something obvious..

ionic shadow
silent badger
#

It happened in both, i just got it working in the build now however, stupid coding mistake on my end. In editor i still get the error. I assume its the same old bug of not being able to use webgl bundles in editor?

ionic shadow
#

Yeah, that's what I assumed, since that's what's happening on android for me

ionic shadow
#

Jesus, why are addressables losing references at random?
-they lose references when an object references a component in a prefab (not the entire gameobject) and the prefab is not marked as addressable
-Referencing a prefab as a gameobject works without having to mark it as addressable
-BUT NOT ALWAYS, as it seems - everything is fine in the editor, but in an android build - references to random gameobjects are getting lost, crashing the game whenever the reference is used.
The error that's showing up is:
The file 'none' is corrupted! Remove it and launch unity again!
[Position out of bounds!]
Marking the prefabs that are "gone" as addressable explicitly and rebuilding the bundles fixes it...
Addressables are cool, but they are SO BUGGY

novel aurora
#

You know you have to rebuild bundles everytime you update something inside them? If you dont rebuild it in unity before throwing it at your phone, your addressables wont be ther eor faulty @ionic shadow

ionic shadow
#

Using BUILT bundles in editor works fine. Using THE SAME, BUILT bundles on a windows build - nope, this reference is gone, and this one as well. You have 20 other objects setup the same way and they're working? Too bad, this one won't work, even though there's nothing special about it ¯_(ツ)_/¯

#

It might also be partially caused by our project using Unity beta 😐

novel aurora
kind relic
#

Anyone have a way to preview which bundle need update before doing a build? I have an issue that if I build multiple time my game, some addressables bundle keep needing update even if nothing change

#

@ionic shadow for the "none is corrupted", look under addressable analysis and fix the Duplicate rule... that's how I fix it on mine

#

and speaking of addressable, I love that one also, so cryptic, just like we love them

steady quiver
#

i'm having a great time (jk) handling unload operations, the first time it unloads it's fine, but after that, i'm getting errors. From what I know Unloading scenes is like Releasing so I wouldn't need to use Adr.Release to clear the handle, right? Also the process is unloading in different variable instantiations, so anyone know an explanation for this?

steady quiver
#

ok, so i've figure out SceneInstance nor AsyncOperationHandles are being correctly stored to later pe used to unload the scene. The question that stays is how are you handling scene reference persistence for later unload?

#

I'm using Lists and Dictionaries, but i guess thats not the point instead the process to save it in this structures

long escarp
#

Hello.

#

Addressables.LoadContentCatalogAsync
Addressables.DownloadDependenciesAsync

#

what is the difference between them?

#

When we want to bound the addressable to the remote catalog, which one should we go for it

kind relic
#

One is just the catalog, you don't need it

long escarp
#

@kind relic and the others then new question comes 🙂
what is the difference between Addressables.InitializeAsync and Addressables.DownloadDependenciesAsync

#

you can bound your remote catalog to the addressable system by just initializing. Right? If so, why on earth do we want to use DownloadDependencies?

#

or we should first initialize and later on download dependincies ?

ionic shadow
# long escarp <@!327114434919006211> and the others then new question comes 🙂 what is the di...

DownloadDependenciesAsync - you pass in an assetreference/label in there, and it downloads and caches the bundles related to that asset/bundles with assets marked with that label, I use it at the start of the game to prepare everything for smooth experience later on.

InitializeAsync- initializes the addressables system basically, it's done automatically be default - you can disable it in addressables settings if you want to

#

if you don't use DownloadDependenciesAsync, you'll have players downloading stuff only when they use it for the first time, which might be bad- for example if you keep all your scenes addressable and suddenly when going between them, a player has to wait XX seconds to download a large scene bundle for the first time

But it might be okay in your specific use case, if you have a lot of small files, and no way to figure out what needs to be preloaded ¯_(ツ)_/¯

kind relic
#

@long escarp initialize is call by all other function in the background, so you don't usually need it. You usually just do DownloadDependency

long escarp
#

thanks for your time to answer first.
but the thing is, I do not want to use "labels" for retrieving data. I only want to use "address" instead.
Because what I have done is:
I have 10 objects in a remote catalog being hold in the server. I only have the addresses of those objects. (I created them in bundle making process.)
So I want to retrieve that asset by using address.

#

Is there any way to do that?

#

@ionic shadow @kind relic

#

1- I want to download all the asset by "addressess"
2- I want to get them by using these "addresses" (not labels or Adress references)

kind relic
#
  1. I don't know, I don't bother to download bit by bit, since it could give a bad experience if the bundle are not locally cached yet.
    2- Those are prefabs? or which kind of object they are.
    For me, since my scene include most of the object so they are all needed when I load the scene. Can you elaborate what you are trying to achieve in #2?
long escarp
#

I have 10 3D beverage objects with material on it and some textures.
What I have done;

  1. I put all the objects into "Addressable groups" and gave them an address. I do not know maybe I should have given a "label" what do you think?
  2. I made a asset bundle files for Android.
  3. Uploaded these files on AWS server.
  4. I changed "remote load path" in profile to point my server.

What I want is
When the app is started I want to download them all without consent of the user. So whenever user do something, I will call one of the assets.

#

thanks for patience!

#

@kind relic

kind relic
#

Ok how do you add those object to the game? are they prefab? Are they already in a scene?

  1. During the "start" of your game call DownloadDependenciesAsync to download everything.
  2. If they are already in a scene, you have nothing else to do
    If they are not, then it depend how you plan to "add" them to the scene
long escarp
#
  1. this is my group. I want to call one of them as calling like that : 500/100.
#

I need to instantiate them in a common scene. I mean my scene will never be changed. These are mesh prefabs

#

You can think of this as a "character selection scene"

#

so when the user clicks the "next" button, the previous one will be disappear and the next one will show up.

#

but all the buttons will be used by the user are going to have an address. these addresses are coming from the Database (dynamoDB)

#

@kind relic

#

I think I should use this method to call a prefab after I download them.

AsyncOperationHandle<GameObject> goHandle = Addressables.LoadAssetAsync<GameObject>("100/500");
kind relic
#

yes... it should work

worthy dome
#

should i bother using addressables for open world or just uninstall the package, anyone know genshin impacts strategy

ionic shadow
#

Well.. you probably will split up the world into separate scenes/prefabs/whatever to load it in chunks, instead of having the entire world loaded at all times, so why not?
I don't know how genshin impact works, I didn't play it, but if it's an open world game - I'd assume the world is split into some sort of chunks.
Addressables are not a must here, but could be useful, if you'd want to iterate some parts of the world, without having to make a new build of the game every time to test it.

kind relic
#

Does anyone know how to identify the missing script when loading adressable and you receive that?

shrewd geyser
# worthy dome should i bother using addressables for open world or just uninstall the package,...

Addressables in and of itself won't be a solution to creating an open-world game (at least, that's my impression of it as seems to heavily look over to Zelda BotW). Addressables might be part of a solution regarding to content managing, but the tech for creating such a game will probably be highly custom. There are some world-streaming assets to be found on the asset store.
A possible implementation for this would be like this:

  • Have a very low-detail model of your environment/terrain that is always loaded in and can be used for rendering stuff off into the distance
  • Have medium detail chunks of the world (prefabs, or scenes) represent environments or regions of the surrounding areas you can go to with your characters. Load/unload them as you move closer to/away from them.
  • Have a high detail version of each chunk of the world loaded in which your character currently standing in and the ones very near to you.

Something Addressables could help with in this case is that you can easily load in chunks of the world and detail based on labels or an address, instead of you yourself looking through Resources etc., or get it downloaded from the server when needed to keep the initial install of the game small, but have it grow over time as the player progresses through the game.

worthy dome
#

will adressable help with this

#

or should i just use resource load

#

:/

#

what do you think genshin impact does

shrewd geyser
#

Addressables can do that for you, yeah.
I don't know how Genshin Impact does it, but it seems to be built on the Unity Engine. So they will either use something like streaming in scenes (using either Asset Bundles, Addressables, Resources), or something custom is possible as well. It's a pretty high budget production it seems, so I wouldn't be surprised if they developed some custom tools for this.

worthy dome
#

very intersting than u

strange bear
#

Anyone have this weird issue where after opening the project for the first time, you need to go into addressables->groups and open a group for it to be loaded properly? Very strange

#

Otherwise it will throw a bunch of errors for me

#

InvalidOperationException: Collection was modified; enumeration operation may not execute. System.Collections.Generic.Dictionary`2+ValueCollection+Enumerator[TKey,TValue].MoveNext () (at <695d1cc93cca45069c528c15c9fdd749>:0) UnityEditor.AddressableAssets.Settings.AddressableAssetGroup.GatherAllAssets (System.Collections.Generic.List`1[T] results, System.Boolean includeSelf, System.Boolean recurseAll, System.Boolean includeSubObjects, System.Func`2[T,TResult] entryFilter) (at Library/PackageCache/com.unity.addressables@1.17.17/Editor/Settings/AddressableAssetGroup.cs:468)

#

If I opened the group once it will work fine...

edgy adder
#

when should one use a group vs a label?

shrewd geyser
# edgy adder when should one use a group vs a label?

I'm not sure I understand this question... They're not really related.
A group defines how you process assets together in terms of building and location. Assets put in a group can be configured to be downloaded from the internet, can be configured to be have a different naming scheme than other assets in other groups, etc. E.g. if you're developing an RPG with different kinds of weapons and armor, you can create a group per item and group the prefab + textures + material, or you can group based on asset type like making a group of all textures, all materials, all prefabs, etc. Whatever works best for the type of game you're building and how you plan to distribute it.
A label is used to find or load assets in the game. E.g. the 'music' label on assets can be used to load in all 'music' assets across all groups.

edgy adder
#

btw, in your example with grouping RPG items — if my prefab referenced textures and materials, and I only explicitly added the prefab to the group, those referenced textures/materials/other stuff would automatically be included in the group, right?

shrewd geyser
slate timber
#

do you guys put animation controllers in addressables too

kind relic
#

Yes you need them

nimble stratus
#

Is there any way I can use addressables within Google Drive?

kind relic
#

Yes... never tried, and it can be complicated if you need to write your own module to generate URL

ionic shadow
#

You’d need to write a custom url resolver and probably paste every url generated by google drive in to that script by hand.
It would also be very slow.
Get the free tier of unity’s CDN instead, if I remember correctly the first 50 GB of bandwidth is free

kind relic
#

Or any cdn, i use bunny and it cost me nothing. Or close to if you use basic service...

buoyant relic
#

I keep getting this error when trying to build my adressables

#

Does anyone know what it means? I had taken it as perhaps i deleted a file that used to be an adressable. & I just needed to remove it fromt he adressables group...but I don't see anything with an empty path

buoyant relic
#

i think iv tracked it down to when it tries to build the materials. I see nothing unique about this particular build group.

iv compared the build group settings to another one that worked, and they are identical.

it bombs out when it trys to build the very first item in the build list. Specifically it bombs out when calling the method "MoveFileToDestinationWithTimestampIfDifferent"

buoyant relic
#

this particular addressable group has not changed in a long time, and has worked the last few builds.

the only difference I can think of between this build & last time that might affect it is me shfiting from the standard rendering pipeline to the universal pipeline. I'm not sure if because it's a material, is there possibly an extra step I have to do to get it working with the adressable system?

i have also tried to remove all of them & re-add them incase there was a funny reference problem, but still no go

#

if i remove the group entirely. I still get this error

#

implying to me that there might be more than 1 problem, or the problem might have nothing to do with what i thought it did.

also tried updating the addressable system in case it was a known bug that was already fixed.

buoyant relic
#

ok...so i removed all the addressables in that group. rebuilt and cut it from the 4 errors to the 1 i posted. I then Added a singular material to the list & rebuilt. And then it went back to the 4. proving it definitely doesn't like the material for some reason & that i probably have 2 problems, though where to begin on the second problem, idk yet.

this particular problem, when i cut it down to 1 material. it still reproduced the problem. Then i 'simplified' the name, on the theory that it was due to just being too long of a path. & that actually seemed to work. I'm going to re-add all the other ones, and confirm the names are all simplified & try again

#

and that seemed to do the trick...now i just have the last funny error to track down

#

ok. i have no idea about the second error. fixing the first one fixed the second one after a reboot.

so root of the problem if anyone runs into it again, i believe is the fact that the group\adressable name was too long because i had it defaulted to use the full path.

solution: right click the adressable to 'simplify name' and that worked. Another option probably would have been to flatten the folder structure in which it resided.

Reason it took forever to solve: nothing about the error message told me what group had the problem, nor what the problem actually was.

shrewd geyser
cursive salmon
#

with addressables, if I want to have images user can download individually I need separate group for every image?

ionic shadow
#

No, make a group with bundle mode "pack separately" and every image in that group will have its own bundle

slim heart
#

Hi everyone, I'm experiencing some weird bugs in my build. Is there any reason in particular why an addressables key lookup won't work in the build?

#

It works in the editor though

#

I'm using Localization

slim heart
#

Got it solved, apparently there's an issue with preloading 🤨

arctic compass
#

Sooo I got an architectural problem I can't wrap my head around.

[Test]
public void ShouldInstantiate()
{
    var builder = new Builder();
    var gameObject = builder.Build();

    ...
}

public class Builder()
{
    GameObject gameObject;

    public Builder()
    {
        var prefab = AssetDatabase.LoadAssetAtPath<GameObject>("...");
        gameObject = Instantiate(prefab);
    }

    public GameObject Build()
    {
        return gameObject;
    }
}
#

I have this builder class that I am using for my unit tests

#

But I want to use the builder also in play mode for actually building things

#

So I need to change the AssetDatabase.LoadAssetAtPath call to use Addressables.LoadAssetAsync

#

The problem is, I can't really use it since I can't make the unit test async

#
public class Builder()
{
    ...
    
    public async Task<GameObject> Build()
    {
        var prefab = await Addressables.LoadAssetAsync<GameObject>("...").Task;
        var gameObject = Object.Instantiate(prefab);
        return gameobject
    }
}
#

This would theoretically possible, but since unit tests can't be made async to my knowledge it's not an option

#
[UnityTest]
public IEnumerator ShouldInstantiate()
{
    var builder = new Builder();
    yield return builder.Build();
}

I could change the unit test to an IEnumerator so I can yield return the Build() operation, but I don't really know how the signature of the Build method would need to look like for this to be possible

#
public class Builder()
{
    ...

    public IEnumerator Build()
    {
        var loadOp = Addressables.LoadAssetAsync<GameObject>("...");
        yield return loadOp;
        var prefab = loadOp.Result;
        var gameObject = Object.Instantiate(prefab);
    }
}

I of course could make the Build method a coroutine itself, but I then wouldn't be able to return the instantiated GameObject

arctic compass
#

I had to add a CustomYieldInstruction to my Coroutine wrapper class and had to write a custom attribute, but now I can do this:

public class CityBuilder : Builder
{
    [LoadAsset("prefab")]
    GameObject CityPrefab { get; set; }

    public GameObject CityObject { get; private set; }

    public override IEnumerator Build()
    {
        yield return base.Build();
        CityObject = Object.Instantiate(CityPrefab);
    }
}

public class Tests
{
    [UnityTest]
    public IEnumerator ShouldLoadAndInstantiate()
    {
        var builder = new CityBuilder();

        yield return builder.Build();
        var cityObject = builder.CityObject;

        Assert.NotNull(cityObject);
    }
}
cedar loom
#

ughh.... it's been a month unity never responded

steady quiver
#

Internal: JobTempAlloc has allocations that are more than 4 frames old - this is not allowed and likely a leak
this seems to be caused by asyncoperations that i'm trying to store? or it could be something else? Also something is causing my build to stop in a loading process and i've already tried to change addressables play mode script to existing build and it works in editor

edgy adder
#

hi friends, is anyone using addressables with user-generated content?

#

like, imagine if users could create their own cosmetics, and those cosmetics would be automatically packaged (by the server, say) as an addressable

#

is that at all possible? or would i be better off just storing the data myself in the cloud and creating objects to represent those cosmetics at runtime?

ionic shadow
#

@edgy adder I don't think that's possible, since asset bundles can't be created in runtime and addressables are just an asset bundle management system, but I might not know about something.

edgy adder
#

i'm not even sure why it's necessary

#

even just trying to get that to work with UGC would be a challenge in itself

long escarp
#

I have 20 stores. and 20 stores have 100 products.

#

all products consist of a 3d object and its dependencies (texture, sound, material)

#

how should I put them into server?

#
  1. should I split them into "catalog groups"? (All the stores have their own catalogs. I call this catalog in runtime according to the store has been selected by user.)
#
  1. or should I change the "profile remote build path" in runtime?
#

all the content differs from each other. So they have no in common at all between stores. What should I do.

#

really thanks in advance.

edgy adder
#

for the life of me i can't get remote content updates to work

#

i can make a build that happily pulls remote content from my server (Unity CCD)

#

but when I run Update a Previous Build and upload the new files and create a new release in CCD, the player never seems to notice the new bundle

#

i even call CheckForCatalogUpdates() manually and it returns an empty List

#

a new catalog is clearly being generated, and it definitely has my changes in it (i inspected the catalog.json)

#

but every time the player starts -- even if i delete its cache -- it fetches the old .bundle, completely ignoring the new one

#

its like it's just not even looking at the remote catalog and instead is just asking for the old bundle specifically by name

#

oh you know what, that's EXACTLY what's happening

#

i just deleted the remote catalog entirely from the server

#

and the app has no issue loading the assets

#

so clearly it's just bypassing the catalog entirely and requesting the bundle directly. wtf!

long escarp
#

but how did you deal with, for example, a store?

#

did you put all the assets that belongs to a "store" and label them to retrieve?

#

@edgy adder

#

I mean I have a coffee shop. the shop has 10 3d objects. how should I approach this?

#

should I pack them all in a asset bundle and retrieve by using label?

edgy adder
#

i'm clearly not an expert on addressables but yeah i think you could use a label for that

#

you could also use AssetReferences directly if the content isn't going to change after you build the player

#

^ check this message

#

@long escarp

long escarp
#

all my content will be at the server

#

I wont have anything even a primitive box in the build app.

#

really got crazy. If I find someone Ill pay to learn 🙂

#

no body know this system.

#

documentations are not enough and there is almost nothing on youtube. everybody copied the others videos.

cursive salmon
#

is it possible to have "fail-safe" path of the primary one fails?

#

like for example, two load paths - game first tries to download from the first one, and if the first one fails it downloads from second path

low halo
cursive salmon
#

yeah, I was more interested in how it can be done with addressables 😄

#

as documentation on this topic is very scarce to non-existent

low halo
#
  1. Try to load the first thing
  2. If it succeeds you're done.
  3. If it fails, try to load the second thing
#

The documentation is fine

drowsy sluice
edgy adder
#

it solves 90% of that for you with just a few checkboxes

rugged path
#

does anyone know if it's possible to get an AssetReference from a Scene that's marked as Addressable? for example, if it's possible what would ?? need to be in this code block?

Scene activeScene = SceneManager.GetActiveScene();

// What can I call here to get the AssetReference?
AssetReference activeSceneReference = ??;
ionic shadow
# rugged path does anyone know if it's possible to get an AssetReference from a Scene that's m...

I wrote a long reply and it didn't go through for some reason, so here's the abridged version:

  1. mark all scenes with a label
  2. Use Addressables.LoadResourceLocationsAsync to load the locations by a label
  3. Go through them, use IResourceLocation.internalId to get the scene name
  4. put them in a dictionary <string: sceneName, AssetReference>, you can create an assetreference by using IResourceLoaction.PrimaryKey as guid.
  5. look up the active scene name in the dictionary to get the asset reference
#

I didn't find any other way to do that, and that's what I'm using for myself

copper lichen
#

How can I check if an AssetReference is "none" at runtime? We just had a build crash because an asset was deleted but the runtime error is "invalid key".

ionic shadow
long escarp
#

I know that I asked several times but really do not understand and started to feel awakward.

#

for answers, thanks in advance.

#

I must change my end point in runtime.

#

I have more than one content. and my "CORE" application will retrieve data accordingly. For instance if you are in Istanbul, you will retrieve data for Istanbul, if you are in London, then your end point will be London folder. I will catch the location information and according to that, I will download catalogs!
Is addressable system the one that I need? Or should I write my own bundle system?

copper lichen
copper lichen
ionic shadow
# long escarp I have more than one content. and my "CORE" application will retrieve data accor...

Is there are reason for that? Will the content differ in any way?
-if you just want to speed up the download speed by choosing a server closer to the user - use a CDN for that
-if the entire content will be different because of <reasons> - you could try doing this: https://docs.unity3d.com/Packages/com.unity.addressables@1.19/manual/AddressableAssetsDevelopmentCycle.html#customizing-url-evaluation and change the URL based on the user location.

long escarp
#

thanks!

exotic tapir
#

So i'm trying to load a compute shader at runtime with Addressables.LoadAssetAsync<ComputeShader>() but I have to run the new build script in the addressable window every time I make a change to the shader, and if i havent made a build at all it fails to load. I thought it was just meant to load it from the asset database if i have playmode set to fastest? Am i doing something wrong?

copper lichen
#

If I do:

await _scene.LoadSceneAsync(activateOnLoad: false).Task;

Will Awake etc. be called before I activate the scene?

copper lichen
#

(I think the answer is obviously no, because the objects don't exist yet)

cursive salmon
#

from AssetReference, which value is the key I can use in Addressables class methods?

#

to be more specific, I have AssetReference to an asset and need to call Addressables.ClearDependencyCacheAsync for that asset

#

would it be RuntimePath or AssetGUID?

rigid needle
#

Hey guys, i'm building a mobile app for ios and aving issues if the users put the app in background mode while is downloading assets through addressable. The download process freeze and blocks everything, searched on the web and documentation but nothing.... do you have any hint ?

raw kindle
#

is there a way to access the addressable group and then the asset list via code?

potent sedge
#

any way to check if an asset exists?

#

Going crazy over here

#

having an invalidkey problem but I havent been able to catch or ignore the error

#

and it crashes on console so I cannot just ignore it even when it works fine on editor

untold warren
potent sedge
#

@untold warren I did build it , it works, it's just if for whatever reason I try to load an asset that doesnt exist

#

I have no way to catch the exception

#

I cant actually check if the asset exists based on it's ID

untold warren
#

can you paste the stack trace of the error?

potent sedge
#

InvalidKeyException

untold warren
#

not the error type but the stack trace

#

if it's a Debug.LogException you can't catch it because it's caught internally

potent sedge
#

let me check the trace but it wont add that much to anything, it just fails to find an asset (because there is no asset with said ID)

#

and yeah, it's internal

untold warren
#

the root of the stack trace of error should show you exactly where the exception is printed from

potent sedge
#

it actually works in editor

#

but the internal error does hang my console builds

untold warren
#

crash probably shouldn't happen normally because of addressable. are you by any chance loading level?

potent sedge
#

no, it loads the asset after changing a level

#

I am just loading an AudioClip

untold warren
#

using AssetReference?

#

or loading by path?

potent sedge
#

nope, using the asset name as an id

#

I had a custom audio system that loaded audioclips from an ScriptableObject dictionary based on ids, but that made it load the entire game's music at once, so I refactored it to load a path/id to an adressable, which works perfectly

#

it just crashes on build whenever it references an invalid asset

#

specifically XOne and Switch, works on PC

untold warren
#

if that works on pc but not consoles that definitely sounds like a bug. Best thing you can do is by submitting a bug report

potent sedge
#

sigh, I think I will

#

I had to do some really nasty workaround in the meanwhile

untold warren
#

play a bit with the addressable sources. in my case it never crashed with invalid key exception but I only make builds for windows

#

also make sure you upgrade your package once

potent sedge
#

yeah, i tested them on windows and they work perfectly, issues began when working on consoles

dusty flame
#

Can anyone tell me how to use split application binary? I want to be able to use the obb file without publishing in app store but manually copying to android folder.

#

I did that, copied the obb file to Android/Obb through my computer but on launching the apk, the scripts didn't run.

#

Could someone please helpe with this?

cursive salmon
#

@untold warren building addressables in necessary before normal build, so another question comes to mind - is it also necessary to commit updated addressables_content_state.bin files, or is just having automated build job commiting it (and uploading any changes to addressables to CDN) once in a while enough?

#

basically, ignore resulting addressables for normal builds and only upload and use results of builds dedicated for this task

untold warren
# cursive salmon <@!565060299611439115> building addressables in necessary before normal build, s...

it's pretty normal to create the bundles along with build if it's deployed along with the executable. But for remote deployment it's really upto you man and how you want to deal with it.

If you want the automate the build process, say release some Christmas stuff on 25th dec, then some new year stuff for your game automatically on 1st jan (just few examples) you can go with the automated process.
but if you want to add some bundles which rely on a script which is newly added to the player then you'd want to deploy bundles right after you deploy your build.
So it's just a design choice really

dusty flame
#

Why do the assets downloaded via addressable have messed up shadows? I am using real time shadows and SSAO in my game.

#

Also, how can I check if all the assets have been downloaded and is stored as cache without internet connection?

#

I am aiming to build an offline game and want the users to download the assets just once and so that later they could use the application offline.

#

Thank in advance

ionic shadow
#

not sure what's going to happen when you call it offline, though

copper lichen
#

What should I make of this?

#

I think this asset shouldn't actually be included at all so should look into that. Although I'd like to understand what this is about.

edgy adder
edgy adder
#

question -- is there an API to allow me to programmatically make a given asset (e.g. ScriptableObject) addressable, from an editor script? and also to add labels/change its group? basically automating some stuff that I do by hand in the "Addressables Groups" window

gritty sorrel
#

I have a set of scriptable objects that I'd like to hold persistent references(meaning if I save the game with a certain SO in use, I can load the game and reference that used scriptable object just by hitting load) to, would addressables be used here?

wraith edge
proper sentinel
#

Does anyone have tutorials on how to use addressables with google's Play Asset Delivery?

past storm
#

Do addressable keys include the group name? I.e. group1/assets/test/test.prefab, or would it just be assets/test/test.prefab when calling LoadAsync

#

cause the second one worked fine in editor but throws InvalidKeyException on Android...

edgy adder
past storm
#

it's actually a scene I'm loading via loadsceneasync

#

Error Unity Exception of type 'UnityEngine.AddressableAssets.InvalidKeyException' was thrown., Key=Assets/Scenes/MapTiles/5_2.unity, Type=UnityEngine.ResourceManagement.ResourceProviders.SceneInstance

#

not sure why it loaded it fine in the editor but not android, I built & packed them

edgy adder
past storm
#

it says exactly what the key is in the exception message (I used a different x/y coord for the screenshot but it does exist)

#

It also works fine in a Windows build, it only fails on Android

past storm
#

Splitting a bunch of terrains into individual scenes inside addressables so they can be additively loaded also made the APK size grow from 400MB to 2GB...and I already fixed any duplicated assets in the bundles (they were all moved to a separate shared group). That's insane.

#

400mb when in one scene to 2gb when in separate bundles. Something has to be wrong here

#

the overhead on addressables/bundles can't be that absurd

past storm
#

yeah just had to do a clean and rebuild, I thought building alone would handle it after fixing the duplicates but guess not.

mighty perch
#

Loading a scene on WebGL that is 190MB works fine directly from its own project, but when packaging it as an addressable it fails to load after the download completes. It's finished downloading the file since the Network tab in DevTools shows it's done but then it crashes Chrome with the Aw Snap page and doesn't even log any errors or warnings either in the console. How would I even go about debugging it because making a sample and testing the bundle load from another project just shows pink shaders in the Editor since its webgl but I can see in the hierarchy panel, it has loaded all the gameobjects from that large scene and even the editor console window has no errors/warnings. But it fails in the browser for some reason. Any ideas why?

swift birch
#

Does Unity intend for you to replace all Instantiate() with InstantiateAsync()? For example, let’s say I am making a 2D top down shooter. Am I supposed to call InstantiateAsync() for every bullet that your gun fires (assuming there is no pooling system)? Or am I supposed to cache the result somehow and only load the asset once, sort of like how you use GetComponent()?

random mango
swift birch
swift birch
proper sentinel
#

I need help with addressables.
The apk in my aab file is greater than the 150MB limit on google play, and the total aab size is at 270MB. So I found a plugin that integrates google's play asset delivery with unity's addressables. So after packing all my scenes into different groups and forming addressable assets, each one of the addressable assets was at least 130MB file size, and after building an aab with the plugin, the apk size reduced to 140MB, but the aab went up to 860MB and after I used LZMA compression, it went down to 768MB. What made the file size so large?

hexed shell
# proper sentinel I need help with addressables. The apk in my aab file is greater than the 150MB ...

https://docs.unity3d.com/Packages/com.unity.addressables@1.5/manual/AddressableAssetsAnalyze.html#check-duplicate-bundle-dependencies

Duplicated assets result from assets in different groups sharing dependencies, for example two Prefabs that share a material existing in different Addressable groups. That material (and any of its dependencies) would be pulled into both groups containing the Prefabs.

proper sentinel
# hexed shell <https://docs.unity3d.com/Packages/com.unity.addressables@1.5/manual/Addressable...

Thanks for the docs. One more question: My addressable scenes has characters as one of its dependencies, and these characters are prefabs, now will the dependencies of these characters(ie meshes, materials, textures, etc) be marked as addressables too?
I guess my general question is: Almost every assets I have in my Assets folder are dependencies to all my game scenes(i.e they are used in my game scenes), do I have to mark every one of them as an addressable too?

hexed shell
# proper sentinel Thanks for the docs. One more question: My addressable scenes has characters as ...

I believe everything referenced by an addressable asset is pulled into the group unless it's already in another group.
I don't do enough with addressables or asset bundles tbh to really know what's the correct setup for you, but I had a setup where we had our scenes in one group, and then assets were grouped into bundles as we saw appropriate, with any asset shared between different groups being added/moved to a group specifically. It's really quite project-specific what your dependencies look like, I've only experienced ones where all that seemed mostly straight forward.

proper sentinel
#

Alright, I'll have to take the trial and error approach. Thanks for responding.

novel aurora
dreamy delta
#

Hello all!
Lets say that I have a game with levels made of prefabs (like a trackmania level's track parts), would using addressable be the way to go to load the level efficiently or is it overkill?

novel aurora
dreamy delta
proper sentinel
drowsy sluice
vapid stag
#

Hi, is there a way to get an asset in a Packed Asset Group with an index number instead of a Path?

vapid stag
#

How would you manage addressables without knowing the path? (too many different path without proper naming convention)

copper lichen
#

Can anybody recommend a bundle analyzer so we can see the total size of assets included in each bundle? I'm trying to reduce build size and addressables content is not covered by the build log (as far as I can see).

copper lichen
#

Ah, I found out how to do it. You can enable a build report in addressables preferences. The content is a bit harder to make sense of but I managed to find some egregious assets by search for patterns including MB.

reef axle
#

Is there a way to set a default value for an AssetReference. Preferably by asset key?

hexed shell
#

If anyone was having performance issues with the addressables inspector that seriously interrupted development, the fix was just released

analog dagger
#

I'm trying to load sprite assets using addressables but I think I'm misunderstanding what a key is. Can I use the shortened paths for keys?

I'm getting an invalid key exception error from the console but I think my keys match the shortened adresses, so i'm not sure what I did wrong.

I'm using Addressables for accessing sprite files at runtime in order to create tiles, these tiles have different themes, but each theme has 12 tiles. With the name and a corrosponding number for a specific tile I am itterating through each possible combination and instantiating tiles.

//here I wait for the sprite to be retrieved
                  for (int i = 0; i < roomTileCount; i++) {
                    s = skinName+"_"+i;
                    AsyncOperationHandle<Sprite> spriteHandle = Addressables.LoadAssetAsync<Sprite>(s);
                    spriteHandle.Completed += delegate { Sprite_Completed(spriteHandle, ref flag, tileList[i]); };
                }
//heres the function, it sets the sprite for the tile once its ready
       public void Sprite_Completed(AsyncOperationHandle<Sprite> handle, ref int flag, CostomTile tile)
        {
            if (handle.Status == AsyncOperationStatus.Succeeded)
            {
                // Sprite ready for use
                tile.sprite = handle.Result;
                flag += 1;
                Debug.Log("Resource has loaded, flag: "+flag);
            }
            else
            {
                Debug.Log("Tile Resource failed to be loaded, flag: "+flag);
            }
        }
copper lichen
#

I'm very confused about how to build my addressables. When I do it via API it takes a very long time, but when I do it via the groups window it's almost immediate...

#

As though it's doing nothing.

#

I haven't used this method in a long time... Is there something I'm missing?

#

Oh wait, yes:

Addressable content build failure (duration : 0:00:16.003)
UnityEditor.GenericMenu:CatchMenu (object,string[],int)
#

hm...

analog dagger
#

I thought that you build the addressables if you are making a build outside the editor

copper lichen
#

I don't know if it is possible to make a build outside of the editor.

#

Ah, it was changing platform + preprocessor symbols and hitting a compile error I hadn't noticed.

analog dagger
analog dagger
sour rivet
#

Anyone knows why this is happening in my build ? A simple terrain shader is now taking 700mb. And some shaders I have not yet loaded are taking a lot of places. This is in my android build using Addressables

real cloud
#

Hello, do someone know if it possible to use addressable at runtime to let a user create a "custom Addressable Assets".

For example: I give the user a "creation mode" who is gonna use assets build in the game, but also assets imported by himself, and I want to let him import and export what he created as a "package".

Is this possible ? Or I should look for another tech ?

mild flax
copper lichen
#

So I just found this bit of code, and I guess I'm wondering if my comment is right?

    public async Task<EpisodeConfig> LazyLoadEpisodeConfig() {
      // Load episode config if it hasn't already been loaded (there must be a
      // better way to do this!)
      return EpisodeConfigReference.IsValid()
        ? (EpisodeConfig) EpisodeConfigReference.OperationHandle.Result
        : await EpisodeConfigReference.LoadAssetAsync<EpisodeConfig>().Task;
    }
#

EpisodeConfig is an AssetReference

real cloud
copper lichen
#

What are the extra fields for in the asset reference object?

    "_episodeConfigReference": {
        "m_AssetGUID": "d32025fdb3e0242278f41d7d075bb062",
        "m_SubObjectName": "",
        "m_SubObjectType": "",
        "m_EditorAssetChanged": false
    },

Should I just be serializing the ID?

#

(This is for a save file)

novel raven
#

Hello everyone, I understand that this question could already be asked, but I cannot find the answer to it anywhere.

I want to use remote Addressables that are stored somewhere (on google cloud for example) and at the same time I do not want these addressables to be included in the application build so that they do not take up space.

If I go to the advanced settings of the Addressables group then there is a field "Include In Build". If I make this field false, then when I try to download Addressables, the error "UnityEngine.AddressableAssets.InvalidKeyException" appears, but the file itself was successfully downloaded and cached.
What is the problem?

swift birch
#

Reading about Addressables, it sounds like people have had to maintain their own version of TextMesh Pro in order to get it to work properly, due to it using Resources by default. Is this still the case?

I want to start our projects with Addressables, but I would rather not have to fix Unity’s packages just to make it work.

past storm
#

I have an odd situation where sometimes after successfully calling insantiateasync for a prefab from an addressable, I grab the skinnedmeshrenderer component on it inside the Completed callback but the bones array on the SMR is all nulls instead of the actual transforms. and sometimes it isn't nulls. seems like a timing thing but I'd assume the Completed callback wouldn't be called until everything was actually ready to go

copper lichen
#

What determines the GUID that's given to assets inside a folder that's included in a group? Am I safe to rename them if I'm serializing their asset refs?

#

This is bothering me a lot

#

I've changed the path to these assets (and renamed them from {episodeName} to {episodeName}_00 yet the old path is still showing

copper lichen
#

Okay, awesome. It's using the internal asset IDs. Safe!

dusty flame
#

Hey

#

I am facing it difficult to update previous builds. Each time, I update my previous build it goes on to update each and every asset. Not sure why is that the case, as a result a new bundle file is created. Shouldn't it only update the files having changes?

dusty flame
#

These are the settings that I have.

sour rivet
#

I am currently having big issues with Addressables regarding to shaders memory footprint. The addressables build is building way too many shader variants and can take up to 2gb RAM of shader files only on my android build. Been looking at shader variants stripping and OnPreprocess shader but honestly I am a bit lost. Anyone stumbled upon such issues ?

The bigger my addressables build is, the bigger the same shaders gets. A simple shader can take up to 200mb on some builds. Only happens when I use addressables.

Thank you

swift birch
# copper lichen You can still include Resources in your build if you're willing to.

Hmmm, my concern is that there are threads on the forums where people have had issues with using Resources and Addressables at the same time, in particular with TextMesh Pro.

Is the only realistic problem with mixing these two systems that you get font related asset duplication, which only increases memory load? Or are there other problems that will require rewriting parts of TMP to fix?

The former I am fine with; font related assets for our projects are not huge, so the extra size isn’t an issue. And as far as I am aware, we will not need to modify the assets at runtime, so the fact they are duplicated shouldn’t cause any issues on its own. But the latter would be a problem.

copper lichen
swift birch
copper lichen
swift birch
copper lichen
#

Or something

#

Just immediately get errors when it tries to grab assets from the bundle.

#

Ah, interesting. Could be nographics. We don't have CD set up so I'm doing local builds anyway, I just do them from a menu in Unity now.

#

What happened before you removed nographics?

#

Tbh I regret implementing addressables, it's been nothing but pain.

#

There are so many problems with it. I think next time I'm going to look into writing my own asset bundles builder... Still have no idea how to tell what's bloating our build. The only thing you get is this nasty unparseable log file that I was literally searching for [0-0]{2,}MB to find files that might be unusually large lol.

#

Also... can't load addressables in edit mode, so any config you have in a bundle becomes untestable...

#

I'm just venting now, but while I'm at it... why are AssetReferences a class instead of a struct, and they don't implement equality!!! So you compare two references to the object and they return false.

swift birch
copper lichen
#

Might be able to go back to my more automated pipeline

#

Very glad I mentioned something

#

Also, I just found a solution for loading in editor :-)

#
    public static T LoadInEditor<T>(
      this AssetReference assetReference
    ) where T : UnityEngine.Object {
      // https://forum.unity.com/threads/how-to-use-addressable-system-in-editor-script.715163/#post-5678014
      var path = AssetDatabase.GUIDToAssetPath(assetReference.RuntimeKey.ToString());
      return AssetDatabase.LoadAssetAtPath<T>(path);
    }
swift birch
copper lichen
#

Thanks buddy. :-)

#

(literally days from release though)

#

haha

#

Probably the best time to find out actually...

swift birch
#

I’ve been converting our projects to Addressables, and it has definitely been a rough process so far. Getting our scene management system to work again in particular has been difficult. Watching Unity’s Creator Spotlight series has been helping to keep me going, haha… “Those devs managed to get it to work, so it must be possible!”

copper lichen
#

It's a godsend.

#
    async UniTask<(SceneInstance, Location)> LoadLocationAsync(string locationName) {
      DebugUtility.Assert(
        _assetManager.HasLocation(locationName),
        $"Location '{locationName}' not found"
      );

      // Load next scene.
      var sceneInstance = await _assetManager.LoadLocationAsync(locationName);

      // Set loaded scene.
      var scene = sceneInstance.Scene;
      DebugUtility.AssertEqual(
        scene.rootCount, 1,
        $"Scene '{locationName}' should have exactly one root"
      );

      // Get location component.
      var location = scene
        .GetRootGameObjects()[0]
        .GetComponent<Location>();
      DebugUtility.AssertNotNull(
        location,
        $"Scene '{locationName}' root object does not have a {nameof(Location)} component"
      );
      return (sceneInstance, location);
    }

    async UniTask UnloadCurrentLocationAsync() {
      DebugUtility.AssertNotNull(_currentLocation.location, nameof(_currentLocation));
      await _assetManager.UnloadLocationAsync(_currentLocation.sceneInstance);
      _currentLocation = default;
    }
#

From AssetManager: it fills the _locations using a label which is set on the scene group.

    public async UniTask<SceneInstance> LoadLocationAsync(string locationName) {
      var resourceLocation = _locations[locationName];
      var sceneInstance = await Addressables.LoadSceneAsync(resourceLocation, LoadSceneMode.Additive).Task;
      DebugUtility.Assert(sceneInstance.Scene.IsValid(), $"Invalid scene '{locationName}'");
      return sceneInstance;
    }
#

This is good if you want string-based loading, which we do for our use case.

swift birch
#

Oh neat, I’ll have to look at that tool. Thanks!

swift birch
#

“MonoScript Bundle Name” is Disabled by default, but the tooltip says that the recommended setting is “Project Name”. Is this a mistake?

A value of Disabled was causing missing script warnings. It seems like the default should actually be the recommended value, as that solved the warnings.

ionic shadow
#

How can I get all the sprites from an addressable texture with Sprite mode- multiple enabled?
I tried LoadResourceLocationsAsync but it only returns the texture Asset and the first sprite...

ionic shadow
#

I worked around this by saving a list of addresses for all of the sprites in the texture, but I don't understand why Loading Resource Locations doesn't work...

vernal pawn
#

Getting this helpful message when I try to build addressables:

UnityEditor.AddressableAssets.Settings.AddressableAssetSettings:BuildPlayerContent ()
XXX.BuildScript:RebuildAddressables () (at Assets/XXX/Scripts/Editor/BuildScript.cs:15)
#

All I can say is "it worked last week"

#

If I try to rebuild the addressables via the Addressables UI rather than my build script, I get this helpful error instead:

UnityEditor.GenericMenu:CatchMenu (object,string[],int)
swift birch
swift birch
# ionic shadow How can I get all the sprites from an addressable texture with Sprite mode- mult...

Unity has an example of loading sprites from a texture in multiple mode in the Addressable samples: “Basic/Sprite Land”. It looks like you can call LoadAssetAsync on the texture, with type IList<Sprite> and the completed callback returns a list of all the sprites in the texture.

One thing I noticed while experimenting with the sample though; it does not look like the order of the sprites in that returned list matches the order as displayed in the editor.

uneven onyx
#

is there any good guidance on what not to make addressable?

vernal pawn
#

Think I'll just have to introduce some new Addressables-specific version control hygiene measures

#

That said, I'll make a note of your solution and try that before I got through the whole reassignment song and dance if this ever happens again, so thanks!

dusty flame
#

And on launching the application it goes on to download everything again.

swift birch
copper lichen
swift birch
uneven onyx
#

when there are duplicate bundle dependencies, what's the best way to figure out what is causing the duplicate dependency?

olive plover
#

Hello everyone, I am using Unity Addressables in one of my projects. There are two packed groups that I have created in my project at my end which looks like the image I have shared below.

When I have built the player & uploaded the assets to the amazon s3 service server & used the given url "https://sloticonsasssets.s3.ap-south-1.amazonaws.com/Android", I am am getting a few errors which can be seen in the screenshot attached below. This error occurs only when run on the android platform but runs fine on editor.

olive plover
#

Addressables loading error