#📦┃addressables
1 messages · Page 10 of 1
thanks 🙂
but it may not actually be preferrable for your specific use case since unity copies stuff around. still worth a look though
So if that fails for whatever reason. I assume Addressables is the next best way to go about this. Quickly skimming that link you sent does look like it will work for my needs. I'll try it and see how i get on. Thanks again for the replies and help
no. if streamingassets is not appropriate for your use case, you can simply just fall back to using normal folders. you just have to get the specific paths then and everything. but that might actually be what you want. that should still work. and since you're building a dj deck, that might be the true best option. streaming assets is more for actual game content i guess. if you just want to do a dj deck, then i would highly discourage you from using asset bundles or addressables, because those will have to be built in editor beforehand. (if you think dj's won't convert songs, they certainly won't do that)
streamingassets is for content that you are including in the game
if you're loading stuff from exterior, like @wooden moss said you will be loading them from disk at runtime
using UnityWebRequest, etc.
Ok so i need to create UnityWebRequests for every single song. Maybe i can use foreach loop to iterate through a folder and load them. Does that sound right? I'm awful at coding. More artist musician myself.
sounds about right
yes. good. use Directory.EnumerateFiles() (there's also Directory.GetFiles(), but you are better off not using that one, gonna stall for a long time depending on the song count)
Oh thanks for the tip. " DIrectory.Enum... " I'll try this. Thanks both for the help. Looks like I'm going to be busy for the rest of the evening trying to resolve this. Hopefully i don't have to pull to much of my hair out in stress 😄 Thanks again guys
if you want i can even get you a short blueprint and you just have to change a few lines. since you said you're not really into coding
That would be very kind and helpful of you. I appreciate that 🙂
ok, just a sec. have to find it first
no problem
No matter if you can't find the bluprint. I think i was half way there already using UnityWebRequest and also using JSON to grab different data types externally. What i didn't consider was creating a foreach loop to get more than one file only. I thought i was constrained to only obtaining 1 file/song/ and why i ended up here asking a question to make sure i was going the right way about this.
nah i found it. just have to edit a line to make it save.
oh ok thanks
have to open the project. that's why it takes a bit :/
no problem. I appreciate your effort thanks a lot
thats what i've got working so far regarding getting data in to unity at run time
so i think i'm half way there as mentioned
video is pretty bad. I've not quite figured out how to get it to look nice.
Just skimming this i think i was on the right track after all. I appreciate you taking the time to get this for me. I'll study it a bit more shortly and see what i can learn from this. Thanks again for your help. If i can repay a favour. You need a model or texture or something made. I'd be happy to make for you. No strings attached etc. Just shoot me a message any time. I really appreciate the effort. thank you
is - this *
👌
thanks again, for the replies all. Have a good evening/ day / morning wherever you are! bb for now 😉
Hi guys
I had a question, why does the Addressable load on Android so slow? Loading time on PC is 1 second and on Android is 5 minutes? !!!
Addressables are super locked down, not what you want for loading files externally. They have to know every asset that exists in advance. It's more for streaming DLC for your game.
Thanks for the clarification Domarius. I appreciate that! 😉
That said, you can definitely load external stuff using it -- but it's a very complicated and extremely poorly documented process
so theres a include in build checkbox
can I set that rom a script
I'd like to have build menus for build group A and build group B
Our usecase is to provide hosting for user generated content like mods
sort of like steam workshop
so we'll have a server/cdn hosting our own and user created bundles
I thought we could have catalogs per user or even dynamically generated catalogs of things a player has subscribed to but it seems the catalog format is quite opaque
the keys seem simple enough but the keydatastring etc are ascii encoded binary it seems
so the next best idea is a catalog per subscribable item or per creator
but still I'll want to generate those smaller catalogs and upload them to our server
thoughts?
I have a potential use case for Addressables:
I have a level editor and the game itself. The level editor is for placing and importing assets, and then it will package everything for the game to use, the same way Creation Kit is for putting together ESM files for Skyrim.
I'm trying to find a good way to bundle up the assets to ecport for the game to use. It's pretty early in the project, so I can afford to change my approach right now. Is this a good use case for Addressables?
I'm considering it, because world information references the assets it needs by name.
Sounds like a good use case. If it's supposed to be for user generated content.
Are there any advantages to Asset Bundles any more or are Addressables basically just power crept versions of Asset Bundles?
Adressables are just superior
Never used Asset Bundles, but this blog suggests that the main advantage is pointed out in the name. They are much easier addressed, also their address can be customized for ease of access which was seeming lacking in bundles. https://blog.yudiz.com/getting-started-with-addressables-in-unity/
And loading and unloading is way better as well as memory handling because assets you use as assetreference in a script inspector are not loaded while prefabs are loaded even if they are not used and so on.
Hello, I'm having trouble with addressable and localization. If I use local path in editor it works. If I try to configure it for remote path I end up with lots of exceptions, starting with :
ArgumentException: JSON parse error: Invalid value.
UnityEngine.JsonUtility.FromJson (System.String json, System.Type type) (at <e27d79fa71fd4d44a57fa16ac139c528>:0)
UnityEngine.ResourceManagement.ResourceProviders.JsonAssetProvider.Convert (System.Type type, System.String text) (at Library/PackageCache/com.unity.addressables@1.19.19/Runtime/ResourceManager/ResourceProviders/JSONAssetProvider.cs:20)
UnityEngine.ResourceManagement.ResourceProviders.TextDataProvider+InternalOp.ConvertText (System.String text) (at Library/PackageCache/com.unity.addressables@1.19.19/Runtime/ResourceManager/ResourceProviders/TextDataProvider.cs:143)
UnityEngine.AsyncOperation:InvokeCompletionEvent()
I'm on the latest version of addressable and localisation for unity 2020.3.30f1
I've tried suggestion found on the forum (disable code stripping, change to filename+hash, destroy and recreate local,...) nothing works.
Does anyone have other suggestions ?
Not sure if this is the right spot but I am working on making custom embedded packages for a game I am working on and am able to build the package and release it via scoped repository and pull it into another project.
The issue I have is that the files and folders of the package that gets pulled in are not showing up in the editor but are present in the package (confirmed with file explorer). Has anyone else dealt with this and how did you solve it?
yes it can be user generated
they will not be inside the Assets folder, they will be inside the Packages folder
ok how do I build and export my asset library to use in a different project? hitting the build button crashes my GPU.
yeah ok are there any good videos on the addressables workflow because i dont 100% get it yet
https://www.youtube.com/watch?v=0USXRC9f4Iw&list=PLQMQNmwN3FvwcDh-oo0lHYyqTo7F8V7t6, I followed this but I'm also having some trouble sith things working once and then not and then working agoin...
Unity Addressables is a powerful asset system available as a package in Unity and today I provide you with a new video where I show you how to install the Unity Addressable plugin, how to configure addressable groups, how to add assets to your Unity Addressable settings, and lastly how to load and instantiate objects via script.
Project shown i...
ok, I think my problem is that I have a few file types that Unity doesn't natively deal with (lua scripts)- which causes the build to fail. How do I solve this? should I make them text files instead?
Hello, do anyone know is for a WebGL build, a local and remote adressable assets are the same, if both are located in the same server where I place my build, or do a local adressable assets in this context will be immediately loaded from the beginning with the build to the cache of the web browser ?
I believe the only way to include assets in the initial download is to use the "include in build" option. You should see it pretty quickly by observing the network tab in your browser debugging tools.
Or is there a way I can make it like the Lua file type
ok, thank you
what do these errors mean?
Should I rebuild when I switch platform?
Everytime you change something inside the addressables prefabs or assets, you gottar ebuild them. Also everytime you switch platform I guess
Oh thanks
Yeah I learned it the hard way debugging for hours on iOS because I got null reference errors all the way until I understood the Addressables debug info...
so it seems like we stumbled on a bug in addressables, monos task implementation or something
we are loading an addressable map, then a whole bunch of prefabs, then a whole bunch of textures
for the prefabs and textures we do Tasks.WhenAll
since all of it is happening using async/await code, the two loads for prefabs and textures happen concurrently
while the map also is loading
the second load (textures) will cause a freeze if the prefab load has not finished by then on linux
freeze meaning the whole editor freezes and has to be killed manually, not even ctrl-c on the terminal will kill it
if I add a semaphoreslim waitasync ... release around the load and whenall, it does not freeze
so I wonder what could cause it, maybe the prefabs load textures as dependencies, then the second load loads textures already pulled in by a prefab, waiting for the same awaitable or something like that?
so for a not-so-large project, and the default rules set, how long should Analyze Rules take?
Unity 2020.3.31 LTS
Guys, I have a very small project with 1 addressables, and when I'm using that code and press Play, unity start to compile code forever, and i need to close it from task manager
op = Addressables.LoadAssetAsync<GameObject>(assetReference);
await op.Task;
And I have that unfixed problems(
If I am using Scenes as Addressables and load the same scene multiple times, does it load the scene asset bundle once and reuse it, or load new asset bundles every time?
I think it only loads the asset bundle once, but increments the reference count multiple times
Thanks!
hey can someone help please; addressables isn't showing up under asset management and i don't know what to do
looks like it works on a new project, but not my older one unfortunately
package installed?
yeah package was installed
is there any way to use TextMeshProUGUI font replacing without placing materials in the Resource Folder ?
i am patching font style with my addressable now and by putting them into addressable means this can no longer be patched and they are shipped with APK
Are there any good book or course about asset bundles and adressables?
Hello, I want to print out my addressable string location like: Assets/18SeamlessNormalMaps512Free/PNGs/W050.png
How do I do that in code?
I have 60,000 addressable assets across different directories. I'm going to creatively have the DEBUG.LOG print out code for them that I can copy paste from the Logs into my C#
I need to be able to know the location to the addressable string representation of the file location tho? Anyone know how to access it? It's the string to right of the addressable checkbox:
Hello. Has anyone had issues with caching on Google Buckets and addressables failing to update to the latest version of a bundle? Seems like it will grab the .hash and .cache file then never update again. I can see in the local cache it clearly has the latest .hash file but and old .json catalog file
Good Day,
Please how do I use addressable to pul video files from my server (mysql) and display it in unity Without updating it all the time
I've Heard unity addressables are for modding unity games does any body have any resources on making a unity game moddable?
You should start with figuring out the basics, like remote bundles, catalog updates, etc. Then you can think about modding. It's all the same learnings.
You can also have a "content" project separate from your main project, should you so desire it
i wasn't thinking of making my game moddable i just want to see just the rough basics since that stuff is advanced
Hi I have an issue with UI Localization, everything seems to work in the app but those errors when I launch it:
Hello there 🙂 I am trying to figure out memory management for my prefab instances loaded from addressable catalog. When i release the instance of addressable prefab gameobject, I see that the texture count and mesh count is not changing. The object itself is released but the mesh and texture seems to stay in the memory. Is it necessary to put mesh and texture into addressable and set those during the instantiating of the gameobject so I will add component for mesh renderer and so on?
As you can see on my screenshot. I have regular prefabs in the scene placed on the shelf. With the script I'm basically taking AssetReference address and setting it onto the EntitySpawner script. AssetReference for the prefab is set correctly but when I try to set AssetReference on the EntityMeshModule, It doesn't work. I had to duplicate all the meshes from the FBX files and those meshes set to Addressable catalog. I'm confused wheter the Addressebles handle the memory by itself or do I need to set mesh, materials and texture sepparatelly? If my case is confusing, let me know and I will try to describe it better. Thank you 🙂
Hello All!
I am currently experimenting with error handling when it comes to using the Addressable System, i.e., when the program is not able to load an asset (primarily due to download issue), it can load a backup asset that is stored locally on the player's device. To do this I am either intercepting exceptions logged by the Addressable System (ignoring everything but Invalid Key Exceptions), or disabling exception logging on the Addressable Settings asset.
My system works fine when using prefab addressable assets, however I am experimenting with using Scenes and have run into an issue.
Right now I am just removing the individual asset bundles in order to force the error system to run. That's probably not the best means of testing the system but I'm not sure what else to do (I am open to ideas).
The issue with this method is that I am seeing the error message in the title in a built game (it doesn't happen in the editor), which stalls loading. Obviously the exception is thrown because the SceneManager system cannot find the asset bundle scene, but my question is, why isn't this logged via the normal Addressable exception logging system, or else passed along to the AsyncOperationHandle like other download errors.
Is this issue only applicable to my testing scenario where I am manually deleting the Addressable Asset files? Or will it show up in a normal game when the asset bundle with the scene fails to download for another reason (connection issues for instance).
Any insight would be greatly appreciated.
I think this just must be a bug, so I am going to file a bug report.
from general:
I'm going out of my mind and would love some help. My game is comprised of a bunch of additive scenes loaded on startup. When I build my game as a Development Build, this runs fine. When I do not build my game as a Development Build, it crashes to desktop after the load is complete. No errors logged, the crash dump file says The thread tried to read from or write to a virtual address for which it does not have the appropriate access..
I can't replicate in editor, even with Use Existing Build on. Have rebuilt my addressables many times, no change in behavior.
Oop, now I am able to repro in development build, which is sort of reassuring. And even with compile flag set for verbose addressable logging, no errors coming up.
Hey can anybody help me to understand this system? XD I'm trying to use addressables to load big scenes in my oculus quest2 (1-3GB each)
What help do you need?
How to correctly release Addressable gameobject if it has also another addressable as a component. Should I first release referenced addressable (component in this case) and then release the game object itself? Or can I directly release gameobject and it will take care of releasing component addressable as well
Unity is the ultimate game development platform. Use Unity to build high-quality 3D and 2D games, deploy them across mobile, desktop, VR/AR, consoles or the Web, and connect with loyal and enthusiastic players and customers.
i have 40,000 adressables in a group and when I try to build them, it took over 100 hours and never finished: https://old.reddit.com/r/Unity3D/comments/tw8nlj/hey_looks_like_just_another_40_hours_left_to/ How do I build em? Someone gave a script but didn't say how to use it. Maybe use his script somehow?
1 vote and 11 comments so far on Reddit
hey y'all! I'm currently trying to integrate Google's Play Asset Delivery (PAD) plugin in my project and use it with Addressables. I saw that Unity provides such a built-in functionality. There is a checkbox called "Split Application Binary" in Edit > Project Settings > Player > Publishing Settings. However I'm not sure how to use it exactly.
- Do I need to configure something else or does this work out of the box when my application is larger than 150mb (restriction by Google)?
- I saw an Addressables PAD sample (https://github.com/Unity-Technologies/Addressables-Sample) which uses some customized scripts, do I need to use them too in order to get things up and running?
- What's the difference between Unity's built-in PAD support and the PlayAssetDelivery.unitypackage provided by Google?
Big thanks in advance ❤️
Do most folks load the addressables that are in use in a scene before the scene is loaded so that there isn't time spent loading it when it needs to be instantiated?
The best time to load something is when you know you're going to need it soon but before you actually need it
So... depends
Hello Everyone I am having challenges loading videos from server as an addressable. Any guidelines I can follow?
Hi, I have a general question about building Addressables. Should Local Groups be automatically included in the StreamingAsset folder? I'm trying to debug why when using the 'Use Existing Build' Play Mode Script and an application build, we cannot access the addressable assets. We've used Remote Groups successfully, but are unable to get local ones to work. We have not edited the paths pair for the local group. We have also build the content bundles.
UPDATE: We ended up deleting the entire AddressableAssetsData directory, and recreating it to get it working.
I'm just starting with Addressables, I have a bunch of prefabs I've made addressable and set their label to "ModObject", but if I call Addressables.LoadResourceLocationsAsync with that as a key I get nothing... what am I missing?
Every time I save my scene, my editor crashes. any ideas?
report it to Unity using the bug reporter, try on empty scene, try using an older version of the scene
how do I get addressables to work on ios?
cause the addressable. groups I have just decided to stop working completely and nothing so far has helped to fix them
why does addressables groups use the key squareapple on ios?
ArgumentException: An item with the same key has already been added. Key: SquareApple
thats is what xcode is telling me when something is being loaded from addressables
what do i even do at this point?
Ive tried a reimport of the project, but nothing has helped it sofar
is there anything else I could try
have you done addressable builds?
If all my bundles are offline, is there any benefit to grouping multiple related assets into one bundle (vs just let each file be its own bundle)?
I'm under the impressions that it's primarily used for bundles across network to reduce amount of requests, and that's irrelevant to my use case where everything is offline.
Hello, is there a way to load an asset via address while omitting it file extension? Example Addressables.LoadAssetAsync<Sprite>("Images/example_img") rather then Addressables.LoadAssetAsync<Sprite>("Images/example_img.png")? In the case i have multiple images in this folder with different file extensions
is there a way to include some addressable groups with build and only some for online download?
Hey guys! How should addressable changes be tracked with VCS like Git, Perforce, etc?
I've noticed those are not stored on the prefabs themselves..
do you mean the bin file?
the groups and everything else is stored in Assets\AddressableAssetsData
The address is determined by whatever you set as the address
You can set it to "Gary" if you want
When I build, /Assets/AddressableAssetsData/Android/* and /Assets/AddressableAssetsData/link.xml are generated
From my understanding all these are for shipping only new/changed assets and I absolutely do not need this feature (all my assets are local and contained in the build)
Is there a way to turn it off or do I just have to gitignore them?
gitignore, but you do need them to be generated
Is there a way to configure where they are generated?
It would be nicer if I can just let them generate elsewhere and not be added to the asset database (so no .meta either)
Kind of annoying to deal with for a feature I don't need.
When people were complaining AAS is designed specifically for mobile and incremental content update, I guess they really weren't kidding.
At least synchronous loading is available now or AAS would've been a nope from me.
UnityEngine.ResourceManagement.ResourceProviders.Simulation.VirtualBundledAssetProvider/InternalOp:RequestOperation_Completed (UnityEngine.ResourceManagement.ResourceProviders.Simulation.VBAsyncOperation`1<object>)
DelegateList`1<UnityEngine.ResourceManagement.ResourceProviders.Simulation.VBAsyncOperation`1<object>>:Invoke (UnityEngine.ResourceManagement.ResourceProviders.Simulation.VBAsyncOperation`1<object>) (at Library/PackageCache/com.unity.addressables@1.19.19/Runtime/ResourceManager/Util/DelegateList.cs:69)
UnityEngine.ResourceManagement.ResourceManager:Update (single)
MonoBehaviourCallbackHooks:Update () (at Library/PackageCache/com.unity.addressables@1.19.19/Runtime/ResourceManager/Util/MonoBehaviourCallbackHooks.cs:26)```
Unity throw these error when I try to load all scriptable object
```public static async UniTask Load<TObject>(string assetLabel, List<TObject> dataList) where TObject : Object
{
dataList.Clear();
var locations = new List<IResourceLocation>(await Addressables.LoadResourceLocationsAsync(assetLabel).Task);
async UniTask<TObject> GetTObject(IResourceLocation assetKey)
{
var tObject = await Addressables.LoadAssetAsync<TObject>(assetKey).Task;
return tObject;
}
var tasks = Enumerable.Select(locations, GetTObject).ToList();
var objects = await UniTask.WhenAll(tasks);
dataList.AddRange(objects);
dataList.RemoveAll(item => item == null);
}```
Hey, I was wondering if I should use Addressables, mostly just because the unity manual says I should use it over loading from a resources folder. I just want to change a UI Elements stylesheet at runtime, so these are not huge files or anything. I doubt it would affect performance much, and I will probably just load them at startup. The main advantage of Addressables in this case to me seems that I could keep a sensible folder structure. Is that worth using Addressables? Do they just work, or is it a lot of hassle to get working? My platforms are standalone and WebGL. Editor version 2021.3.
If you want to switch between two-three predefined stylesheets, adding Addressables is not worth the effort. Just create a serialized list of stylesheets and iterate over it. You don't have to put them in the Resources folder either. You will benefit from Addressables in this case only if you think you will need to tweak the stylesheet later when the project is built and installed to users' devices. With Addressables, you will be able to replace stylesheets on the fly without requiring users to reinstall the application. For example, you may want to create a special Christmas UI style for your application, then return it back after the event is over. If the UI is final and you just want to provide users with several UI options, don't bother using Addressables.
Thanks, I'll try to look up that serializable list thing then. I thought I might have to make some StyleHolder : MonoBehaviour and attach that to my main camera, then attach the stylesheets to that, or something silly like that.
Hmm, I guess that might still be my best option
Someone please help, I don't know why editor keep spamming unknown error in AsyncOperation
I haven't played with UI Tookit for Runtime, but from I've read in documentation, you can either create multiple PanelSettings assets and replace them in the UIDocument components of your game objects, or create multiple stylesheet assets and replace them in one PanelSettings asset that you reference everywhere. Depends on what better suits your case.
some variations let you pass a completed callback directly
does addressables work for ios or is it still in development?
Hello, I read from here there are 3 ways to handle uneeded cache data https://docs.unity.cn/Packages/com.unity.addressables@1.19/manual/RemoteContentDistribution.html#assetbundle-caching
I went with UpdateCatalogs, I'm trying out the Addressables.UpdateCatalogs sample code here https://docs.unity3d.com/Packages/com.unity.addressables@1.16/manual/UpdateCatalogs.html
However, my catalogsToUpdate.Count is always 0 even if I replace the StreamingAssets folder. Is there something else I should be checking?
I was testing this in a webgl build.
Also which file is the "Content Catalogue". I read the definition of Content Catalogue, but I don't know which file it is referring to (is it in the StreamingAssets folder?)
Anybody else experiencing terribly slow loading times on Android? It's basically unusable
I didn't do InitializeAsync() or Enable DisableCatalogUpdateOnStartUp(). Not sure if it solves it yet, doing a test build. Reference: https://forum.unity.com/threads/i-think-i-dont-understand-how-checkforcatalogupdates-work.904508/
[EDIT]
CatalogsToUpdate.Count not 0 anymore after I update streaming assets folder! However old addressable cache still exist. I'm suppose to do something with autoCleanBundleCache. Haven't figure out this part yet
[EDIT..again]
Turns out autoCleanBundleCache is in a higher version then what I have. I'm on Unity 2019 which is using addressable 1.16.19 and I can't seem to update to 1.19.4 which is where autoCleanBundleCache was added. So either I upgrade my Unity version or I have to find another way
So according to package manager, my addressable is already up to date at version 1.16.19. However in the documentation, the drop down to choose a version, it lists there are newer version compaitable with 2019.4+ https://docs.unity3d.com/Packages/com.unity.addressables@1.19/changelog/CHANGELOG.html#1170-preview---2020-12-13
Is this a package manager bug or a documentation error?
I do want to try addressable version 1.19 because that is whereautoCleanBundleCache was added
heyo, I updated a prefab creating a new animator controller, and now i have a problem:
- I have a scene where there are intances of said prefab, and some more get spawned on start.
- when building, the ones present in the scene have the correct animator, the spawned ones have not
- all the involved asset bundles have been updated and rebuilt and are included in the build
Should I be aiming for a certain number of assets per group/asset bundle? With 600+ items the editor UI sometimes has long delays
so, I'm not sure where to ask this
but I have a scene
and I want to save it and it's direct references
aka all the assets present in it
convert them to an asset bundle
and then send it to my database
so, I want to save the scene and all the assets in it and convert them to some file via code
in a plain asset bundle or an addressable bundle?
it should be possible directly with addressables
Sorry for my laziness, but could someone show me how to load the built addressable?
@mental orchid Depends on how you want to do it. Here's a good tutorial on how to do it with the AssetReference type: https://www.youtube.com/watch?v=uNpBS0LPhaU
Thank you!
Oh one other resource, If you prefer reading code over tutorials. Great repo for addressables: https://github.com/akauper/Addressables-AssetManager
Any experience working with scriptable objects guys? I just caught a duplicate bug and decided that removing addressables is a faster way. Just wanna know some tips from you guys for future
guys can i load sprite atlass in addressable and should i do that in my project ?
I use scriptable objects all over my project. Unsure what you are referring to about a duplicatation bug and how removing addressables fixed your issue>
I was wondering if there was a way to filter out certain entries from Addressable Groups during the build process of creating bundles and still have the bundles packed together.
The use case would be multi platform development as you could have objects specifically designed for each build target (PC/ mobile) but you don't want the pc targeted asset being included in the mobile build.
Say I started an async load operation and store the operation handle somewhere. Then a script comes back and asks for the result, but it's still loading. Now say I want to subscribe to that in-progress operation to run some code when it finishes. Do I have to use the CreateChainOperation API? Or can I directly subscribe like handle.Completed += MyCompletedMethod;
This is assuming I already subscribed to Completed when I started loading, but now I want additional code to subscribe.
Could you use Labels for this?
Does anyone know any of the most common causes of this error?
Exception: Attempting to use an invalid operation handle
Triggered by calling
Addressables.Release(handle);
handle isn't null.
lol I guess I can just call if (handle.IsValid())
I'm trying to design a function that takes an id from an enum, and it returns the asset reference. Say for a list of enemies. However, all I'm coming up with is just matching the enum string to the addressable path. Any ideas on how to go about this on a cleaner way that avoids string comparison?
I'm working on this "big" legacy project and one idea to improve it is to have a Game state Manager based on Addressables to load scenes for each Game State as Menu, Combat etc... The question is... When moving to Addressables can I only deal with Scenes as addressables and things that are in the scene leave them be?
You can choose fire each object separately if it should be addressable
This is a very big project, kind of a mess, I want to be able to start improving and something I want to do is a scene registry so I was thinking on addressables to be able to reference scenes in the inspector to manage game states. My doubt is if I just make scenes addressables should I also make all the objects in the scene? Again this is big project
You could also use addressable prefabs to do that. Question is if loading/unloading will fix complexity issues. Scenes are a relatively crude loading mechanism that you can largely replace with addressables
The actual system is all over the place and the loading unloading is done using scene names as string each game state is comprised of many additive scenes. I wanted to change that for something centralized that will register a connection between game state and scenes needed for that, to clean that hardcoded hell. That's why I thought on addressables so it can be composed in the inspector dragging scenes needed for state. I was researching also how to use scenes in inspector without addressables. If addressables will make me change everything I will go for the alternative. Makes sense?
They certainly can solve that problem
been using them for that exact thing regularly, I just use prefabs to represent state rather than scenes.
Yes, states will be SO but if I load scene as addressable I need to change everything that's in the scene?
my understanding is if you make a scene addressable all the contents are addressable and included in the same bundle
guys how to fix this error : Error while downloading Asset Bundle: CRC Mismatch. Provided 2f06fad, calculated 39c4bdc6 from data. Will not load AssetBundle
Anyone knows an easy way do clear all addressables cache (all groups)?
make sure the asset downloads correctly
Hi there!
Let's say I'm working on an rpg, with a seamless chunk-based world and lots of items, NPC's and so on.
I would like to know how I need to categorize my addressable assets into groups to load them in relevant way.
I definitely don't want to group by asset type (weapons, food, characters) This will result in currently unnecessary assets being loaded.
I want to confirm something, because I'm struggling to find a way to verify it in Unity. I have a scriptable object that I load as an addressable through AssetReference that references other scriptable objects directly (not using AssetReference). Do these "children" objects get loaded as part of the asset bundle, or does it somehow reference ones in memory? I have one of these children not marked as Addressable, and it seems to behave the same as the ones marked as Addressable - does this make any difference? thanks
The asset downloads correctly, but this came from my code
I didn't check some value is null or not null in pre download function so the error happened, thanks for your help
How can I access and edit the "Local Variables" of a Localize String Event from a script? I want to edit the gold cost of a chest during runtime using a value from a script, but I couldn't find how to do so.
Trying to use addressables, but getting error for attempting to load an instance already loaded. Can anyone help me with the right way to prevent reloading?
Code for load and release wrappers: https://paste.ofcode.org/5nR2mumZgZkLPR7psQFDE4
For more info, it's to load animation sprite sheets, and it should only have one instance loaded at a time.
in other words, what are the best practices for load/release wrappers?
Hello!
I really need help)
I have public AssetReference sceneReference;
I put my Scene there.
Then i try to get scene name by sceneReference.SubObjectName
But SubObjectName is empty. I cant understand whats wrong
Any one?
help((
Scenes don't have subobjects, and are not subobjects (if I'm understanding what this is exactly). What are you trying to do?
im try to get scene name
there is my thread with code examples
i use SO as data container with scene information. in it there is:
public class SceneBaseScriptableObject : ScriptableObject
{
public AssetReference sceneReference = default;
}
then i want send it to SceneLoader to load the scene
so i try to get scene name like this String currentSceneName = scenesLoadList[i].sceneReference.SubObjectName;
it was in tutorial of Unity Open Project
AssetReference . Name is null to
I doubt you can get the name of the scene without loading it - that is unless the RuntimeKey is set up to contain that information
it's the RuntimeKey that is used to load the scene if you call LoadSceneAsync on an AssetReference
maybe you can get the file name of the scene?
Sorry for bumping it, but... I really would like to know how could I group my assets 🙂
I don't have kind of "levels" in my game, it's just a big seamless world.
Is there a way to get AssetReference of all assets by label? I really need hashes 🙂
You can load them as groups and process them.
In small scale I usually use a script to use their file names as asset name and output those names as a list to drop into enum so I can access them with code completion.
what i want is save AssetReference.AssetGUID for subscribers, then load assets and find relevant subscribers for assets. For now the only way i see is to process each AssetReference separately.
(And put them on start into a dictionary with enums as keys to access)
there is no way to get asset guid from gameobject in build, am i right?
It looks like it's runtime thing https://docs.unity.cn/Packages/com.unity.addressables@0.1/api/UnityEngine.AddressableAssets.AssetReference.html
yes, this works fine in build. But i've ended up with huge SO which stores all AssetReference i loading ONLY because i want to use AssetGUID in build to be able to remap result.
Instead i want to just ask Addressables to load whole group and then remap, but how to get GUIDs? Or may be another way to do remap, but by what data?
I think you can include your map in addressables, or data to construct it. Then process the group at runtime. I haven't done experiments with that though.
you mean some component directly on asset with some key?
Yea, I'm guessing at this point, I haven't done something like that in practice.
i'll give it a try
SBP ErrorError anyone know how to fix this ?
Look up the log, that just means that some sort of error (an exception probably) occurred and therefore the build stopped
its an awful error message but the details should be somewhere further up the log
The console log only shows 3 error like the picture and has no details
I've checked all code and it worked normally. But I still have no idea why addressable build fail. Have that error came from other plugin ?
Hello, can addressables be used to deliver entire scenes?
how is it possible to use tilesets with adressables? dont want to load sprites via scene.
Hey
I have a bunch of assets group, that i want to load at the game start
they have different files types and folders
Can i load them like:
private AssetReference[] initialAssets;
this.initialAssets[iAsset].LoadAssetAsync<Object>();
Can there be done anything to improve the performance of spawning in adressable gameobjects ? Like making the spawning way faster ?
Anyone ?
Another quick question... should i mark every prefab itself as adressable in the inspector ? Or is it good enough to just mark its folder as adressable ?
addressables are super fast
Alright and there cant be anything improved ? Im spawning in like 1k prefabs using adressables and it still lacks like 1 second.
Which is great, but i wonder if it still can go faster ^^
wtf? it only takes a tiny moment to load the asset. after that you use your cached version so that should not take any time at all
Thats basically what i spawn in like 1k times... it still generates a noticeable lag ^^
Those are pretty much my groups ( the names say everything ) so the tree is part of the prefab group
However, i have the feeling that this is why it takes so "long" ^
It clearly shouldnt reference bundles like animations... or fonts
Is this normal ?
no you have to define the dependencies
What do you mean ? ^^ how can i define the dependencies ?
Furthermore, does it make sense to split the bundles into "Prefab, Icon, Animation,..." ?
it makes sense to split the bundles into logical units.
Could you define that ? Are file categories no logical groups ? ^^ And what do you mean with "no you have to define the dependencies" ?
unity has perfect docs on addressables
and no. file categories are not logical groups
not for addressables
e.g. anything in a particular scene could be a logical group and could make sense packing together
Thanks ! So instead of file categories i should rather choose like a "Environment" group which bundles environmental prefabs, fbxs, materials and textures ?
Could this be the reason why my current adressable asset lags when being spawned in ?
it makes sense to bundle anything together that is used together, but if that's inside 1 bundle or multiple bundles bundled together depends on the game. but putting ALL text assets or ALL textures or ALL [something] into 1 package makes most often no sense
Thanks... Damn than i missunderstood that... i thought it would be an good idea because its organized this way xD
I also thought that e.g. a prefab from the prefab bundle could then just have a single depedency to a icon from the icon bundle and this way its effecient ^^
speaking of performance - any idea why creating a build with a completely empty addressables build (all groups not included) takes roughly 250% longer than a build with no addressable build at all (cleaned)?
"Failed to compile player scripts" typically means that a script was invalid when building the packages. So I would assume that you are using some sort of function that is not available in a build (like editor functions), or are using some #if / #else / #elif / #endif in a way that includes code that is not valid for the one you are building.
If you don't have any compile errors when you play in-editor, I would specifically look for editor functions as that is the most likely thing.
Okay so, when do I need to release addressable assets and when do I not need to release them?
also, how do I set a folder to automatically have everything in it be addressable? I used to be able to do that but now I dont know how
can you not just drag the folder into the groups window
wait, it does it for scriptable objects but not text assets
how do i do that with textassets?
mmm it's a yaml file I made in my editor directly in the assets folder so I guess technically not imported? it has the icon. the inspector looks like this: (i made it addressable manually)
Looks fine. It should work fine, no idea why it would be any different
Hmm. Well I guess there’s no real reason for it not to be a scriptable object
you need to release them when you don't need them anymore. you don't need to release them when you still need them
well now it works. after I change everything over to a scriptableobject.
the reason I ask is if I make something like this where I am just loading something by name, do I have to somehow keep track of everything and dispose?
static Item getItemByBaseID(string bID)
{
AsyncOperationHandle<Item> opHandle = Addressables.LoadAssetAsync<Item>(bID);
return opHandle.WaitForCompletion();
}
great
how you insert code in message?
anyone familiar w/ how to load a specifically typed mb class rather than having to unbox a game object?
getting failed key exceptions when loading as custom class, but no exceptions when doing so as game object
I need help.
I have asset bundle which includes folder with Scriptable Objects.
How can i load them all?
Bundle packed together.
I use AssetReference in my code to link them.
not familiar w/ loading bundles, but i have an abstract static script for loading and managing assets
Pastebin.com is the number one paste tool since 2002. Pastebin is a website where you can store text online for a set period of time.
it works by tying the address name to elements in an enum
public enum MaterialAddress { PxShader };
public class MaterialHandler : OpHandler<Material, MaterialAddress>
{
}
eh, i can't get syntax highlighting for whatever reason. Anyway, that's an example of its implementation
thanks. my problem is in LoadAssetAsync<T>(key); is T...
then all u do is load it in a coroutine
yield return MaterialHandler.LoadAll();
LoadAssetAsync<T>(key) is for loading a single asset at the address(key) afaik
yep, so if asset have folders in it, what i need to put in T? or how to load it?)
thats my problem)
there is image in my first post with asset. i dont understand how to load it
i cant understand it(( they use Addressables.LoadAssetAsync<GameObject>("addressKey");
but my asset not GameObject. so i dont know what put there
yah im not familiar w/ ur set up
here's an example of mine, i just load things individually
so however ur setting up ur groups, research that and look for solutions that involve that method
documentation is naturally all over the place, so ur gonna have to do some digging and research to understand what exactly ur setting out to achieve
i don't think Addressables.LoadAssetAsync<T>(key) is the way to go
a folder group will never have a type T
nor will it really have a key
yep, thanks for your participation
private void InitializePersistentAssets()
{
for (int iAsset = 0; iAsset < this.persistentAssets.Length; iAsset++)
{
Addressables.LoadResourceLocationsAsync(this.persistentAssets[iAsset].RuntimeKey);
}
}
It seems to work
How can I check in the editor which assets have been loaded?
maybe have a serialized field for the asset ref and store the refs there
probs have some mb w/ that info
is there a reason u need to see in editor what's loaded/
u could just run a check thru a method and send the check info to debug
check the addressables event viewer
So i just opened Unity and all the scripts kinda broke.. the text is still there but it shows this message under everything that used them is there a way to fix that?
When i try to add anew one it shows this
yeah. fix all compile errors
ok so how do I load all assets that have a tag? Addressables.LoadAssetsAsync<NPCSchedule>("Schedule", loadedSchedules.Add); I think is just looking in a path that does not exist
Hello! I have a question about how Addressables work.
So say I wanted to spawn 100 particle systems from the same prefab. Is the advantage of Addressables:
- loading the asset reference one time and instantiating that result 100 times
OR - loading the asset reference 100 times and instantiating each individual result
The reason I ask is because I'm writing an AddressablesManager that would preload each prefab that I'm using and having other scripts instantiating them whenever they can. I'm just not sure if that's exactly how they're supposed to be implemented.
If you want to instantiate them instantly, just use Addressables.InstantiateAssetAsync for each instance you want. Later you can release them with Addressables.ReleaseInstance(<instance ref / handle>).
If you want to load it into memory once then instantiate them as needed, use Addressables.LoadAssetAsync then Object.Instantiate the resulf of the operation for each instance. You would need to Object.Destroy each instance and then release the handle yourself.
You can also Addressables.InstantiateAssetAsync but instantly set them inactive or something to have them instantiated and ready, but not visible.
Hi, I have a system that i wanna implement using the addresables and assetbundle.
So what I want to achieve is basically create a gallery app which has an external folder local/remote that it pulls the images and videos from. And when the content in the local/remote folder is updated or changed the same is reflected in the app without actually going into editor.
And the images/folder should be in thier own folder (basically a folder for any file type)
And the app should update the changes in the local/remote file structure.
I have also been reading on streaming Assets regarding this.
Any help and insight regarding this is much appreciated.
Definitely go for the Streaming Assets option if you only need things to work locally. Very straight forward. If you do it via addressables you'll have to manage the catalogs and all the bundles manually essentially.
Okay good but here's a query how can I achieve for the app to automatically update the folder structure.
Say for ex. In the images folder there are currently 5 images and the app shows them. Then went ahead and added an image making it 6 images locally. How can i make it so that the app can detect that new image and add to the existing list of images without restarting the app.
This is usually called 'watching'. The most simple way is by checking in Update(). But not every frame - only when at least x seconds have passed since you last checked.
Oh cool, but how would I check for the changes via scirpting. I went to the unity and it doesn't mention regarding that. Do you have any links and stuff I could read up on.
I also tried searching unity watching streamingassets it gave me results on how to play a video in unity lol.
Thanks a lot for your help 
Hello, is there any way how to obtain simplified address from the AddressableCatalog, if I have the GUID from the asset?
How do I load everything with a label?
Ok, so I have this group here, with some things that have labels. When I try to load my scriptableobject like this:
Addressables.LoadAssetsAsync<NPCSchedule>("Schedule", a =>
{
print(a.name);
loadedSchedules.Add(a);
});
The path is found, but nothing is actually loaded. What am I doing wrong?
TestSchedule is the right type, I checked.
Beginnerish question regarding addressables and scriptable objects since I'm not that familiar with their relationship: If I change some values in some of my addressable SO assets, or use them for an event system and just swap out some references in some addressable prefabs, WITHOUT code changes, do I still have to rebuild my project or can I just publish the addressable changes and call it a day? (idk if this fits in #archived-code-advanced or not)
Did you rename either the file or the class itself? Unity only sees (in my case) component/monobehav/etc classes with matching filenames
i didn't rename anything
Tried just loading an object, threw errors
I have a situation where I'm loading a scriptable object via AssetReference, the loaded object has AssetReferences which then point to other assets (so on and so forth). I was wondering if there's a proper way to go about handling this sort of chain? I've seen a chain operation of some sort in the addressables/resource management API documentation but I haven't been able to find any documentation which describes if this is what I'm looking for or not.
Any tips?
Not sure if someone answered, but this can't be done according to the documentation for addressables. You have to load the object then retrieve the component.
The type of the asset you will load. Any type deriving from UnityEngine.Object
You can right click on entries in the groups window and simplify, but you may want something else. Are you working with the catalog in the editor yourself? I'd be interested to know how this works.
What do you mean by "The path is found"?
If anyone has any hints or pointers on this original question I'd love your advice.
When I pass in an invalid tag it gives me an error. When I pass in the proper tag it has no error, so I’m getting the right tag, but nothing is loading
Key not found?
Well it's not complaining because it does have a group with that tag.
As for why you're not seeing anything loaded, I have a suggestion.
One moment
Do something like this:
var loadHandle = Addressables.LoadAssetsAsync<SomeType>( "key", (c)=> { ... } );
loadHandle.WaitForCompletion();
foreach( var res in loadHandle.Result )
{
Debug.Log(res.name);
}
I saw a similar thing when trying to use the callback.
But waiting until the operation is completed, either synchronously or asynchoronously works better in my experience.
In the case above you see loadHandle.WaitForCompletion is called to stall the main thread until the loading is done in the background.
Then the results are available after.
I prefer using async methods and calling await on loadHandle.Task, personally.
But my code base requires alot of this sync calling with WaitForComplation as we're cramming Addressables in a bit late.
Does this make some sense @cedar trail?
Yes, I’ll try it if I have time
Hope it helps
Actually I may be lying but I haven't looked too deeply. Look here for what appears to be loading of a component directly? (not sure at this point): https://github.com/Unity-Technologies/Addressables-Sample/tree/master/Basic/ComponentReference/Assets/Scripts
will check it, but i figured out some alt solution. i'll dig it up to share
what i ended up doing was write a generic static class to load and retrieve addressables, tying the type of asset to the generic and address to an enum
The generic:
https://pastebin.com/pMY0cVEz
Pastebin.com is the number one paste tool since 2002. Pastebin is a website where you can store text online for a set period of time.
Sprite extension example:
public enum IngredientIconAddress
{
CharcoalIcon, EggIcon, BaconIcon
}
public class IngredientIconHandler : OpHandler<Sprite, IngredientIconAddress>
{
}
Cool, glad you found something workable
The mb component generic:
public class OpHandlerPrefab<T, E> where E : System.Enum
{
private static Dictionary<string, AsyncOperationHandle<GameObject>> _opHandles = new Dictionary<string, AsyncOperationHandle<GameObject>>();
protected static string GetKeyStringAddress(E e) => e.ToString();
public static T Get(E e)
{
var key = GetKeyStringAddress(e);
if (_opHandles.ContainsKey(key))
{
return _opHandles[key].Result.GetComponent<T>();
}
return default;
}
public static IEnumerator Load(E e)
{
var key = GetKeyStringAddress(e);
if (_opHandles.ContainsKey(key))
{
yield break;
}
var handle = Addressables.LoadAssetAsync<GameObject>(key);
yield return handle;
if (handle.Status == AsyncOperationStatus.Succeeded)
{
_opHandles.Add(key, handle);
}
}
public static IEnumerator LoadAll()
{
var enumNames = System.Enum.GetNames(typeof(E));
for (int i = 0; i < enumNames.Length; i++)
{
var key = enumNames[i];
if (_opHandles.ContainsKey(key))
{
continue;
}
var handle = Addressables.LoadAssetAsync<GameObject>(key);
yield return handle;
if (handle.Status == AsyncOperationStatus.Succeeded)
{
_opHandles.Add(key, handle);
}
}
}
public static void Release(E e)
{
var key = GetKeyStringAddress(e);
if (_opHandles.ContainsKey(key))
{
var handle = _opHandles[key];
Addressables.Release(handle);
_opHandles.Remove(key);
}
}
public static void ReleaseAll()
{
foreach (AsyncOperationHandle<GameObject> handle in _opHandles.Values)
{
Addressables.Release(handle);
}
}
}
so in the end i just load in advance and use GetComponent<T> in the getter when retrieving the addressable
but u gotta treat it as game object everywhere else til u unbox it
Cool dude, thanks for sharing
absolutely
oh, well. that was easy. Thanks. I think I forgot to call WaitForCompletion haha, im still not used to how this system thinks
I've run into my fair share of issues. I'd really rather I not be migrating a product over to use it. A fresh start with proper opinions on initialization would be pretty nice.
No problem.
guys how to cancel instantiateAsync or loadAsync immediately?
[QUESTION]
I never heard about addressables and came across them recently and want to know whether they are the solution to my problem.
My goal is to have a local folder that can be accessed during runtime and post-build. I should be able to add/remove/move/change etc. textures into that folder to load them dynamically during runtime into the application.
Are addressables going into the way of solving this task or am i on the wrong track?
Mmm I think you should instead look into Streamingassets
Thank you, will do that.
Are there any decent resources on how to best organize addressables across groups? In my mind it seems like groups can be used either for specific types of assets (sprites, models, material) or for a domain of assets (soldiers, tanks, buildings, etc). Or are groups really necessary and you can just put all addressables in the same group. Note this is regarding desktop games and dont care about remote hosting.
neither of those.
you should group addressables into logical groups. for example: every asset needed for a particular scene. addressables are about modularity. you want to not load unused assets.
Has anyone here had an issue with meshes loosing tangent data when using addressables? "Optimise Mesh Data" is off in player settings...
@wooden moss do you have a reference that would support your response?
Because your response would only apply if a scene has fixed assets and wouldn't include assets that could be used later on.
Like maybe a type of tank is not used when loading a scene but could be added later. Based on what you say that means any possible thing that could be loaded in that scene should be in the same group
i said: logical groups.
if you may need an asset you of course have to load it
and i didn't say everything needs to be in the same group. the groups can still be split up further. but it makes almost never sense to put e.g. all textures into one groups, all meshes into one group, etc
Well you said everything in a scene so that's where I got that assumption sorry. So if you had a game with a bunch of factions then every faction could be considered a group?
everything that's loaded (one or more addressables) should be currently in use (or could be in use soon). don't put things together that are not used at the same time
Hi,
Guys please help out me with this, it is really urgent
So I have a query regarding addressables that suppose I am creating a game which I want to get played on both android and IOS, so in what way can I export a single bundle which consists data for both platforms and upload it to the cloud (suppose total data size is 500 mb, data of 250 mb for each platform), then while downloading it in the apk itself once installed on the device how can I make it possible to download only the platform specific data from that single bundle which was uploaded on the cloud so that it does not download complete bundle of 500 mb and downloads only the required bundle size for that specific platform
thanks in advance
Is there an easy way to load assets with adressables using a URL at runtime like you would using UnityWebRequest?
like downloading a json file that contains the URLs to all the assets (mostly whole scenes) and be able to download and load the
scene by clicking a button in the game.
Somewhat easy. You use this: https://docs.unity3d.com/Packages/com.unity.addressables@1.14/manual/TransformInternalId.html
@rich plover I believe you can also either use this technique or else build one set of assets and app per platform - but I’m not that familiar with the latter.
Thanks @mild flax I've tried this out, but I keep getting an error about the scene bundle not containing the scene I try to load from it. However the same code works fine when I set the link in the addressables profile before building. I'll have to try this out again. I was wondering if someone else had tried it and it worked fine.
Yea it’s hard to give general advice as every setup is different but I can at least say we’ve got this working. Be sure that you are uploading your catalogues and requesting the catalog before trying to load the scene. We also use the irrsourcelocation returned by the catalog when trying to load the item - which I’d recommend.
I was not requesting the catalog before loading the scene. Can I download the catalog using WebRequest and set the internal Id to the sourcelocation from the catatlog?
We use this to first get the catalog, then find the key in the returned locations: https://docs.unity3d.com/Packages/com.unity.addressables@1.14/manual/LoadContentCatalogAsync.html
Thank you I will try this out.
You need to be logged in and make sure package manager not blocked by firewall or security app
guys why i can drag this to prefab in project windows?
Question similar to addressables, the resource folder: I remember having to copy a folder from the /library into my Standalone compile folder to get /asset/resources to work in a live game. Is that true? I have since forgotten that and cannot internet search the information. If this is not the right subdiscord to use, let me know the proper one if you like.
best practice for any unity project: do NOT use the resources folder
That's what I figure. The plan is to try and bring it up to addressables. /assets/resources did quite rule before addressables because GUI game dev is backwards and slow. Addressables fills the gap.
How does Addressables behave regarding EditorOnly tag ? Does it still bundles things referenced on this object or does it behave as we would expect it : excluding it from bundle
Any clue on this standalone error: System.Exception: Invalid path in TextDataProvider : 'D:/starfighter/starfighter_Data/StreamingAssets/aa/settings.json'.
There is no settings.json in my datafiles at all
Any help with this error that shows when going to standalone:
System.Exception: Invalid path in TextDataProvider : 'D:/starfighter/starfighter_Data/StreamingAssets/aa/settings.json'.
So weird, can't launch game, will be day 8 of not being able to make a standalone
EditorOnly only works with instances in scenes, and that would work as you'd expect. EditorOnly tags on assets are ignored regardless of whether you use addressables.
Hi, I am new to the world of addressables.
Am I correct to think that Groups = Bundles ? (I mean for each group, one bundle will be generated)
Maybe it was added when making a group but doesn't exist anymore ?
Update the bundle, clean and rebuild it perhaps.
I have selected default locale greek but every time i start the app it changes to english. Any idea?
Is it possible to bundle files raw without having any asset processing? I have some JPG/PNG files I want bundled but just as the raw files.
I'm beginning to think that this is impossible without some workarounds
I'm finding that it wont accept the JPG/PNG files unless I convert to a texture
You gotta change the import configuration for those specific files.
Or
just change extension(I imagine unity won't tell what it is) and add it to the group, it will get bundled as it is. Then you can load it as Texture on the run.
How's that an addressables question?
Thanks, I've found some writings on giving a dummy extension, but can you point towards the configuration changes?
Localization is part of the addressables
I haven't done it myself, so you'll have to play around. Click on the image file and see if you can change compression algorithms around.
That screebshot says otherwise (the Addressable checkbox is empty)
Or is that a configuration Addressables system generates automatically? , I am no expert, so I won't know.
how to load prefabs using addressables?
GameObject go= await Addressables.InstantiateAsync(assetName, new Vector3(0,4,0),Quaternion.identity).Task;
I'm adding JPG files to an addressable group as shown.
When it comes to load them, trying to load the asset as a text asset with the key on the left gives me an invalid key error
Going through the keys in the catalogue just shows the one bundle file
Any ideas on what I'm doing wrong?
Hi guys
I have a question
"UnityEngine.AddressableAssets" does not exist in the Node library section, how can I have it?
thanks for the reply! it works now, 🙂 one more thing though, how to check the progress?
like 0 percent -> 100%
Not sure there's an easy way to do that. Since it's an async method you could stick it in a Coroutine and see what's inside the .Task portion of it.
If you're more just worried about handling it correctly, since it's async you can do
In a Coroutine/IEnumerater and yield return it.
In an Async function and do await.
Or you can add a hook, I believe there's OnLoaded
There's also LoadAsync or something similar that just loads it into memory and gives you the reference to the prefab/image/etc. without instantiating it anywhere
Has anyone seen this after constructing an AssetReference and passing a guid from another instance of AssetReference into it's constructor?
InvalidKeyException: Exception of type 'UnityEngine.AddressableAssets.InvalidKeyException' was thrown
I'm providing a valid GUID which I retrieved from an AssetReference where the asset was assigned in the editor. Very confusing.
Can't really find any clues.
Addressables.LoadSceneAsync((SceneManager.GetActiveScene().name+"Assets"), LoadSceneMode.Additive).Completed += SceneLoadComplete;
Why this code dont start SceneLoadComplete function on WebGL build? Any ideas?
It downloads bundle, adds it to cache and stuff, but never runs SceneLoadCompleted
Hey I am having an issue with my apk being too large. I want to put my level scenes into an Assetbundle which now seems deprecated and we should use addressables but I cant figure out how to create an assetbundle from an addressables group and then have that not included in the apk. Any help would be much appreciated
Does it execute in the editor/player?
Yes, in Editor it works flawlesly. With all PlayMode Modes.
You might want to try using await method instead of the listener event. Not sure if it will make a difference but maybe webGL is being wierd about the oncompletionhandle https://docs.unity3d.com/Packages/com.unity.addressables@1.5/manual/AddressableAssetsAsyncOperationHandle.html
I will try. Tho before I was able to make it work, so I am very confused.
it does seem odd that it worked before and works in editor. Maybe Cache issue also?
Well not webgl cashe, because my server setuped that it cleares cache on new webglbuild. It seems something with loading assets, it never completed. It downloaded but then stoped and did not actually loaded. maybe there is time out of download?
could be I would check timeout settings on server
Now when I think about it.. it should be the case, as size of asset did not change... Well I guess I will just go with it as long it works.
have you tried analyze tools of addressables. It have option to fix objects that are used in multiple bundles, in that way reducing size dramaticly.
hmm no I have not
I will try that to reduce but I am really trying to figure out how to upload a game larger then 150mb to google play console
Also check addressables settings, you can find that on profile. Wait a sec i will send screenshot after build is complete
I just found something where there is an option in publish settings for split application binary I think this creates the traditional obb expansion file for android apps that might resolve it for me
You can setup load addressables from remote server here.
The google docs are confusing they say for unity to use assetbundles and then theres a small note saying no use addressables now and that links to unity docs that say how to use addressables but not how to use addressables as assetbundles
my brain hurts and its 2am also not helping lol
Cool I saw that too but then I have to host the addressables somewhere right?
I thought Google supported up to 500mb or something but the apk has to be under 150
same Xx. I bet you checked this one:
https://www.youtube.com/watch?v=BXdwcSLWXK4&ab_channel=DilmerValecillos
Today I show you how to use the Unity Addressable system to load and unload scenes in Unity, we will continue from my previous video where we setup Unity Addressables groups from a remote location path (remote server).
This tutorial assumes that you are familiar with Unity Scene Management system since we use load scene modes to keep a main sce...
Yeah loading Addressables I understand I have most of my assets loaded that way via code but its this assetbundle/expansionfile/addressable/binarysplit without hosting my own server deal
lol
Ill tackle it again tomorrow, good luck with the completion handler! I hope u figure it out!
Thank you. Ger rest good luck tommorow
Hi guys!! Is there a way to grab the name of an asset from an (unloaded) asset reference? The editor seems to do that when you drag/drop an asset into an AssetReference field. Thanks!
When calling the LoadAssetAsync or DownloadDependenciesAsync is there a way to track show download speed and the mbs downloaded ?
Is there a nice way to "override" one adresssable with another?
E.G if I have "wood.jpg" in a loaded addressable...
I want to load a second addressable that also contains a "wood.jpg" that will take priority when loading
DownloadDependenciesAsync returns a AsyncOperationHandle which has a property PercentComplete. I think you might be able to combine that with GetDownloadSizeAsync and figure out the rest.
if it's a different .jpg it should be named differently
They're not. The entire "vanilla" data for the game is an addressable also. So "wood.jpg" in Vanilla is the default, but somebody could make a mod with "wood.jpg" that I want to override
then you should just load the addressable you actually want to use
Becomes complex when I have thousands of files.
If I have say 10 mods loaded, that means checking each individual one for any number of files, then disabling them in vanilla. The time complexity of that will become unhinged at a certain point
It would be much easier to go
Load all Vanilla
Load Mods on top, overwriting if needed
and way more ram expensive
Not necessarily, did some testing of trying to load multiple of the same addressable address and it adds a tiny overhead
I have a clunky system for this anyway, I was just wondering if there's any Addressable-suggested or common way this is being done so far
if you have 2 different addressables that have practically the same data, you add 2x memory
Not if they use the same address
I'm not sure if it's noticing it's a copy and ignoring the load, or overwriting the old info
it does increase but not by anything noticeable
your approach is bothersome
This is how most modern moddable games do this, at least on the surface
The only difference is I'm using addressables because it makes prefab modding a lot easier
most modern moddable games do NOT load the same thing 2x
This isn't loading the same thing
This is having multiple assets using the same address
and overriding each one with the next
exactly
Which is quite a common way for mod loaders to work...
that's not how addressables work
From the bit of testing I've done so far, it is
I can replace an asset with a similar sized asset and I only see Ram usage go up by the difference, plus change
you're just trying to add mod support to your game using addressables right?
seems you don't have any problem then
Like I said, I was just wondering if there was any Addresables-suggested methods for this or common practices
Not on overriding specifically
if you are loading the mod addressable and not the vanilla adressable, you don't need to override
The mods are modular in that they might only override 1-10% of the vanilla set
so item by item overriding is a necessity, it seems to be fine just loading them on top, and the Ram overhead seems minimal, but I definitely don't feel good about it with no docs on how that memory allocation is working
well, don't rely on unity for anything modding related. it's not something they support
I mean modding is a concept, Unity supports a lot of things commonly used in modding flows,
addressables are just the most proprietary thing they've made towards it
no i mean the unity team does not support modding of games.
addressables has nothing to do with modding nor was it explicitly made for modding
Their suggested tutorials on it are literally for modding
people on this discord even got warned because they even mentioned modding
so don't expect any docs on modding workflow
...They already have multiple for it on the official Unity Docs
and I find that hard to believe
i do not because it happened
and you just said you don't find any docs on it
a discussion on modding the Engine I would believe, but using Unity to allow modding a game, not at all
Not on item by item overrides, there's plenty on swapping out one pack for another
no. about modding a game
well that is common for strictly vanilla workflow
In that case I very much doubt it was because of the discussion topic 🙂 They have tons of references to it all over the place
To be clear, we don't allow discussions on how to decompile/asset rip existing games. If you want to make your own game moddable, that's a different discussion.
ok, well that seemed somewhat different at the time. apologies
@wooden moss I believe you can load the metadata of all the bundles first, resolve the overrides, then load the assets
I'm currently trying to figure out what I need to do to support loading from addressables for mods
hello, i need help with getting the same function as AsyncOperation.allowSceneActivation in addressables, any ideas? thanks in advance!
like i want to display a message first before the next scene load
running in editor?
build and run
so u build and run
yes
usually i have this problem when i run in editor but works fine when i build first then run manually
dont know about build and run, sry mate
well I don't know because I build and run and it launches the game and the buttons are purple
maybe wait for the experts in addressables to reply
yes ^^
To me the Addressable Asset System is perfect for mods, right?
Addressables are such an obnoxious pain, they won't work in standalone, despite literally not changing in UNITY eidtor since my last standalone.
Bring back the resources folder, at least it could compile standalones.
Can anyone please look at my settings? https://www.youtube.com/watch?v=A1XAGaf0n_4 1 min 11 sec video, I lost a literal 100 hours on this over the past three weeks on Unity Standalone headaches.
My standalone did not compile with addressables, despite it compiling to standalone with addressables before. I did not change anything with it.
Are my settings messed up or something? This Unity error is standing between me and frequent 2 patches a week patches in my game. 100 hours is a lot of time to lose in 3 weeks due to Unity issues. Ad...
I found a man who has a bug with addressables that hasn't been fixed in 2 years: https://www.reddit.com/r/Unity3D/comments/h9oom1/having_trouble_with_unity_addressables/
Its the same bug as I experience, it won't compile to .exe. How about you hire me as cheap as possible, I fly out there, fix it for you since no one could fix it in two years? Compiling to windows shouldn't be rocket science, for UNITY staff or Unity Users. Unity Users should just check one box that they want their addressables to compile with standalone. Why doesn't it do that? It's like owning a yacht that cannot leave port.
It really just sounds like that guy didn't build addressables before building the player
not had any problems with the localization package whatsoever. maybe your project is corrupt?
Thats an error in Unity. Its a bug in the reorderable list. The latest patch version of Unity should fix it.
why does the default path has "aa" as a folder ? What does this means ?
Addressable Assets afaik
Hello Guys It's so nice to be here! I've a quick question before I will actually introduce myself.
We run a succesful game, we have however a problem with stacked download of the catalog.json from Google Storage. At initial loading of the game.
Did anyone have the same experience? And possible solution for that?
Hello, I am trying to build a game but it always fails at the part when it builds it with Il2cpp and i get this error Message
"UnityEditor.BuildPlayerWindow+BuildMethodException: 2 errors
at UnityEditor.BuildPlayerWindow+DefaultBuildMethods.BuildPlayer (UnityEditor.BuildPlayerOptions options) [0x002bb] in <7d90b28560b644ce87b8263efcc36eed>:0
at UnityEditor.BuildPlayerWindow.CallBuildMethods (System.Boolean askForBuildLocation, UnityEditor.BuildOptions defaultBuildOptions) [0x00080] in <7d90b28560b644ce87b8263efcc36eed>:0
UnityEditor.EditorApplication:Internal_CallGlobalEventHandler()
"
Has anyone experience with that? looked around in the unity forms but it seems like everybody has only problems while trying to build on android but i am trying to do that on Windows with the version 2019.416f1 and have fishnet installed does that stop it from building?
This error message just says you have another error message
For addressables, do i need a CCD/CDN or can i just sorta use a plain file/web server?
In a sence for small groups testing things as we go dont really want to pay for a cloud >.> but also dont want a log of extra work either, so like the catalog info and such does it need a certain kind of server or just have those files accessable like threw a url
Is this the right error Message?
"Exception: C:\Program Files\Unity\Hub\Editor\2019.4.16f1\Editor\Data\il2cpp/build/deploy/net471/il2cpp.exe did not run properly!
Failed running "C:\Program Files\Unity\Hub\Editor\2019.4.16f1\Editor\Data\il2cpp/build/deploy/net471/il2cpp.exe" --convert-to-cpp --emit-null-checks --enable-array-bounds-check --dotnetprofile="unityaot" --compile-cpp --libil2cpp-static --platform="WindowsDesktop" --architecture="x86" --configuration="Release" --outputpath="C:\Users\pross\Documents\David 3d\Unity\Allstarsclonclone\Temp/StagingArea/Data\Native\GameAssembly.dll" --cachedirectory="C:\Users\pross\Documents\David 3d\Unity\Allstarsclonclone\Assets..\Library/il2cpp_cache" --profiler-report --map-file-parser="C:/Program Files/Unity/Hub/Editor/2019.4.16f1/Editor/Data/Tools/MapFileParser/MapFileParser.exe" --directory="C:/Users/pross/Documents/David 3d/Unity/Allstarsclonclone/Temp/StagingArea/Data/Managed" --generatedcppdir="C:/Users/pross/Documents/David 3d/Unity/Allstarsclonclone/Temp/StagingArea/Data/il2cppOutput"
stdout:
il2cpp.exe didn't catch exception: System.InvalidOperationException: C++ code builder is unable to build C++ code. In order to build C++ code for Windows Desktop, you must have one of these installed:
Visual Studio 2015 with C++ compilers and Windows 10 SDK (it cannot build C++ code because it is not installed or missing C++ workload component)
Visual Studio 2015 installation is found by looking at "SOFTWARE\Microsoft\VisualStudio\14.0_Config\InstallDir" in the registry
Windows 10 SDK is found by looking at "SOFTWARE\Wow6432Node\Microsoft\Microsoft SDKs\Windows\v10.0\InstallationFolder" in the registry
Visual Studio 2017 (or newer) with C++ compilers and Windows 10 SDK (it cannot build C++ code because it is not installed or missing C++ workload component)
Visual Studio 2017 (or newer) installation is found using Microsoft.VisualStudio.Setup.Configuration COM APIs
Windows 10 SDK is found by looking at "SOFTWARE\Wow6432Node\Microsoft\Microsoft SDKs\Windows\v10.0\InstallationFolder" in the registry
bei Unity.IL2CPP.Building.CppProgramBuilder.ThrowIfCannotBuildInCurrentEnvironment()
bei Unity.IL2CPP.Building.CppProgramBuilder.Build(IBuildStatistics& statistics)
bei il2cpp.Program.DoRun(String[] args, List`1 foundAssemblies)
bei il2cpp.Program.Run(String[] args, Boolean setInvariantCulture)
bei il2cpp.Program.Main(String[] args)
stderr:
Unbehandelte Ausnahme: System.InvalidOperationException: C++ code builder is unable to build C++ code. In order to build C++ code for Windows Desktop, you must have one of these installed:
Visual Studio 2015 with C++ compilers and Windows 10 SDK (it cannot build C++ code because it is not
installed or missing C++ workload component)
Visual Studio 2015 installation is found by looking at "SOFTWARE\Microsoft\VisualStudio\14.0_Config\InstallDir" in the registry
Windows 10 SDK is found by looking at "SOFTWARE\Wow6432Node\Microsoft\Microsoft SDKs\Windows\v10.0\InstallationFolder" in the registry
Visual Studio 2017 (or newer) with C++ compilers and Windows 10 SDK (it cannot build C++ code because it is not installed or missing C++ workload component)
Visual Studio 2017 (or newer) installation is found using Microsoft.VisualStudio.Setup.Configuration COM APIs
Windows 10 SDK is found by looking at "SOFTWARE\Wow6432Node\Microsoft\Microsoft SDKs\Windows\v10.0\InstallationFolder" in the registry
bei Unity.IL2CPP.Building.CppProgramBuilder.ThrowIfCannotBuildInCurrentEnvironment()
bei Unity.IL2CPP.Building.CppProgramBuilder.Build(IBuildStatistics& statistics)
bei il2cpp.Program.DoRun(String[] args, List`1 foundAssemblies)
bei il2cpp.Program.Run(String[] args, Boolean setInvariantCulture)
bei il2cpp.Program.Main(String[] args)
UnityEditorInternal.Runner.RunProgram (UnityEditor.Utils.Program p, System.String exe, System.String args, System.String workingDirectory, UnityEditor.Scripting.Compilers.CompilerOutputParserBase parser) (at <7d90b28560b644ce87b8263efcc36eed>:0)
UnityEditorInternal.Runner.RunManagedProgram (System.String exe, System.String args, System.String workingDirectory, UnityEditor.Scripting.Compilers.CompilerOutputParserBase parser, System.Action1[T] setupStartInfo) (at <7d90b28560b644ce87b8263efcc36eed>:0) UnityEditorInternal.IL2CPPBuilder.RunIl2CppWithArguments (System.Collections.Generic.List1[T] arguments, System.Action`1[T] setupStartInfo,
gosh is this thing long
It's telling what the error is and how to fix it
And can I translate it somewhere that smallbrains like me are able to understand it?
Which part is unclear?
i dont know why it is missing the c++ workload component or what this is
Not really important why they were missing now that you know what you need, is it?
I guess so
hmmm
I am having this error in Android Build
Build won't work because of it
I am not certain though if addressables is the one to blame here, but stacktrace ends on it
Is it normal that Addressables creates an empty StreamingAssests folder in the editor ?
yup, that folder, depending on your build target also gets generated in your build directory. it contains various data/settings files that are used for configuration and location. you can read about the process and details in the Build Artifacts sections of the docs: https://docs.unity3d.com/Packages/com.unity.addressables@1.19/manual/Builds.html
this is especially relevant if you're using a remote configuration, depending upon your content delivery, you'll likely need to use a build process that ensures that folder hooks into your build pipeline if depending on your setup.
Hello ! I have another problem (yes, again...)
I did solve my problem with addressable I had sooner, but now, my problem is : It's working only if I don't unload any scenes.
I looked in google and it basically saying me this : " The SceneInstance to handle is added to the cache of scene loads upon Scene load complete. It will also be removed from the handles cache if the Scene was unloaded by other means, such as if you previously did a LoadSceneAsync( "otherscene", SceneLoadMode.Single). Because SceneLoadMode.single will unload other scenes. If you load another scene before this, the scene you are trying to unload will already be unloaded and removed.
" in a message from unity technologies.
Well yeah, great, but now I'm stuck since I start in a main menu, which load me a environment and a level on top of that (which give me : One scene unloaded and two scenes loaded) and I want to restart le level one, which work...If I load it in additive on top of my menu. Which is not what I want either.
Could someone help me please ? I'm so lost to be honest...
Good morning!
Is it better to explicitly include dependencies in a group? For example for our character models we typically just include assets we directly load via addressables such as the prefab, animation controller, and blendshapes. But there are other assets such as materials, textures, animations etc. that implicitly get included during the build.
I was thinking that it might reduce build times a bit (reduce the work required for the calculating dependencies stage) but it didn't seem to have much of an effect... What do you guys think?
Hello ! One more question ! 🙂
I've seen that the cache expiration is 150 days, how could I remove this limitation to get "eternal" caching of my assets, and only clear the cache manually when I need to ?
I did not find how to get access to this parameter :/
it would not make the build times any faster but it would make the catalog bigger, which would increase load time.
@native steppe try #💻┃code-beginner
is there any way to get the Addressable Groups tab to refresh after modifying files outside of unity?
Hi,
I'm using Unity 2021.3.0f1, and I would like to upgrade to addressables 1.20.3 but the packages manager only shows me version 1.19.19
How could I do this upgrade, if this is possible ?
For those who know, I'm stuck on the "scriptable objects references are lost within addressables"... It seems that some people did find a solution to this problem, but it's still not clear to me on how to solve this problem.
Does anyone here have some advices to share on this topic ?
What happens to a partially downloaded addressable/ catelogue?
one that fails to fully download? i assume it gets purged from memory and therefore not cached on a user's machine.
more for the user closing the app
I believe they would have to start over from 0, there is no "partial download" written to disc that I am aware of
thanks
Hey, could someone help me. Me and my friend made an organization project and its not showing up on our unity hub
did you try rename it