#📦┃addressables
1 messages · Page 1 of 1 (latest)
I've been pondering this as well. Here's kinda the rundown of my personal thoughts. Addressables have potential to store certain assets in a separate location outside of a project (to be fetched at runtime) - it would exist on a webserver hosted on premise - you'd need to maintain code that connects your projects to those assets at runtime - runtimes would differ based on platform -- production releases would ship with everything - unless you wanted to host a webserver on localhost
For my purposes, I have some projects that are common to all games being worked on. So instead of storing these common things inside every single project, maybe use addressables to only fetch those things at runtime. This would save space and if you made a change to the common assets it would propagate to all other projects instead of having to update every single one
It kinda seems like a lot of work at the moment not worth pursuing
hey guys! I've been trying to get CCD working with remote addressables in my project, and I'm running into some really weird issues.
Are addressables really only compatible with a specific old version of it (1.0.0-pre.2) even though the latest version of CCD's Management API is showing to be 2.1.0?
when i install latest (2.1.0) i get told it's not even there:
How you guys managing shader variant with addressables? it creates all possible variants of URP lit... Which is crazy load to memory size. Stripping manually is quite complicated. what I am doing wrong that it makes that happen. I tried to add all materials in use to addressables, but that just increased the amount of shader variants generated.
Did you get answer somewhere for this?
Hi. I got a question about addresable scenes. Do they need to be included in Build Settings ?
no
No, but they do need to be in an addressable group if you wish to ship them with the build itself and then actually build the group before you make a Unity build. You can find addressable groups in Window -> Asset Management -> Addressables -> Groups.
I highly recommend making a custom build script that performs this step for you whenever you make a game build, otherwise you'll forget plenty of times.
How to make a build script:
https://docs.unity3d.com/Manual/BuildPlayerPipeline.html
Building addressables through script:
AddressableAssetSettings.CleanPlayerContent();
AddressableAssetSettings.BuildPlayerContent();
Dumb question, if you can is there a way to connect your game to discord if as a multiplayer game to apply a role if you use get lets say verify your discord from in your game through commands and what not so now your discord is paired with your game, lets say in the game you get banned. Is there a way get a automated role if you achieved said role in game?. Worded that poorly haha
Yes this is possible. #📦┃addressables is not the place for that question though, probably #archived-code-general or #archived-code-advanced
understood, was confused as of where to put the question
was expecting a "help" area my abd
Hi !
I have a new problem 🙂
I am building asset bundles within two projects
project A is the main project, project B only contains scenes and assets
in project A, I have a scene with a canvas and some buttons
which is loaded at the beginning
then I load the catalog from project B
load the test scene from this asset bundle
this scene also contains a canvas with a button
as soon as this scene is loaded then buttons on the initial canvas (which is permanent using DontDestroyOnLoad) are losing their images and the text elements inside the buttons are losing their fonts
the buttons are still here and interactable... but completely invisible since any graphic asset has been lost
any idea on what could cause this ?
the scene in project A, is it part of the build scenes or is it part of an asset bundle or addressables?
do you load the scene in project B with LoadSceneMode.Additive or .Single with the canvas in scene A being DontDestroy?
i'm asking because a scene is like an asset bundle. when the scene gets unloaded, all its assets get unloaded as well, in this case the font.
the scene from project A is part of an asset bundle
scene B is loaded in .Single mode with the canvas being DontDestroy
so your explanation about assets unloading makes sense
@violet flume in my situation, what would be the right way to follow ?
Using additive mode and unloading unwanted scenes by hand ?
Hi all, is there a way to prioritize which asset I'm loading if 2 exist with the same name? I'm using this as a modding system.
E.G bundle #1 has stone.jpg and bundle #2 has stone.jpg
I was under the impression that the most recently loaded one took priority, but that doesn't seem to be consistent
Hi guys, I have a unity application that loads different addressables based on which user that logs in. I want to know if it is possible to build out addressable groups individually rather all at the same time?
For when I make a change for one group I would rather update the build for that group rather than having to process all the groups i have created.
currently trying to use GetDownloadSizeAsync in a project, but always return 0 everytime I run it in Editor, but return the expected download size after the project was built. Is that intentional? Is there any way to simulate the download process when I'm at the Editor?
AsyncOperationHandle<long> downloadSizeHandle = Addressables.GetDownloadSizeAsync(key);
await downloadSizeHandle.Task;
size += downloadSizeHandle.Result;
The size will be 0 if the bundle is already cached.
Is my request possible?
How can I make asset path for asset bundle
For arranging level folders according to missions
I think it is not possible since every time you build the bundle, it only create 1 catalog and hash file
Hmm i tried to clear the cache using Caching.ClearCache but still no result
I see. Thank you for taking the time to reply. I appreciate that.
It is possible but you will have to create your own editor tooling to track and handle it. We do this but it is quite a lot of work. Also if you want a user to download a combination then you need server side stuff to track that too.
This should work but sometimes the cache can’t be cleared if the content is already in use at all. I would recommend logging out the cache path, closing unity and making sure that the file is deleted in the OS.
Many thanks for that clarification. Yeah from the sounds of it, its going to be a lot of additional work, which might not save us that much time overall.
Thanks again @mild flax.
Yes I did ! Ended up doing my own shader stripping solution. Been working perfectly for our production for the past 6-8 months on mobile.
Some posts where I explain my process but I feel you stumbled upon them if you found my message here.
I must say, I do believe there must be a way in some addressables package version to completely dodge this problem, but I have tried about every "solution" on forums and they never fixed this problem. And seeing that you have this problem now tells me this has not been fixed. But honestly, stripping the shader yourself saves a lot of memory footprint even if you were not to have this addressables-related issue. We got used to it real fast. If you want more details don't hesitate to DM me.
Hi,
we are facing performance issues with addressables that are linked to the shaders. We have custom hierarchical structure of models in our scene....
Hello, I am checking if a list contains SO(ScriptableObject). It works fine in editor but returns false in build. SOs are addressable. I am new to addressables, can anyone help?
have you built your addressable content?
yes
I think same problem: https://answers.unity.com/questions/1752609/addressables-system-assetreference-equality.html
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.
Hello everyone. Do you know if it is possible to discharge the assets of a specific object downloaded via addressable from memory scene when this object is destroyed?
If i use Destroy(gameObject); Texture and Mesh attached to the object remain in memory. While if I use also Destroy(myTexture); and Destroy(myMesh); the memory scene memory is cleaned up. Is there anything that makes this process automatic (and most important works in WebGL)?
Thank you.
The goal of the automation process is that I I no longer have to check which and how many textures exist before deleting them and son on.
This is likely because you are comparing them by reference and they are not actually the same instances. You would need to compare a unique id that they serialize or their index in another SO for example.
Thanks, I realized same SO is used by different scenes, so when I load a scene it creates another instance. Do you have a suggestion for fix? I am going create a class like SOAssetDatabase so they will be created only once and other classes will ask to this db instead of using SOs directly.
Okay, I started working on Addressable for a job requirement,
I have too many problems with remote packaging, I want to know first,
Addressable can automatically search for resources by name instead of giving long urls,
For example Addressables.InstantiateAsync("AssetName")
But can this apply to remote search?
I can successfully search for resources using local, and I have not made any changes,
Just uploading the same package to the server, everything messed up, I can't find the resource at all
This is my Addressable Setting
And this is code
When I do this locally, the resource can be successfully searched and loaded,
The remote always gets nothing, g always gets Null
Is this okay? (Performance or potential bugs) It will only load once in the scene and I couldn't really wrap my head around preloading adressables in bulk
Yup that’s the way. One tricky part is how you know which SO to ask for - you could do it by name or save a unique id in each SO. Fyi I made an asset called BTagged to do the latter but you should be able to make your own system or just use a tags name depending on the complexity of your project.
@rancid crystal there's no point making load assets to coroutine. otherwise it looks fine.
and probably you need to wait for loading for those probably, you doing just unnecessary work with subscribing with event. just load assets sync with handle.waitforcompletion()
can Addressables be used to convert a whole scene/level into an addressable?
For example, I would like to allow users to create their own levels in Unity, then export them to a mods folder, and load the mod from the main game. Is Addressables what I should be using for this?
Can addressable use to download scripts update and then after update restart the game?
Exception encountered in operation Resource<IAssetBundleResource>(xxxxxxx.bundle), status=Failed, result= : RemoteAssetBundleProvider unable to load from url https://xxxxx.amazonaws.com/Android/xxxxxxx.bundle, result='HTTP/1.1 403 Forbidden
I need help with this error, the AWS bucket is Public
Trying with the google cloud service it works well 🤔
Cross posting from other channels not sure where to ask:
#💻┃unity-talk message
Is there a manual way to trigger Remote Asset Bundles to be generated outside of Include In Build within the Packed Asset group being enabled? This setting, to my understanding, kind of defeats the purpose of having a remote catalog of assets that can be requested outside of the main data file.
This is likely an object permissions error. It's hard to tell precisely what options you need to account for here. Looks like you're using an AWS service. If publicly accessible objects are possible, ensure you're setting read/read permissions on the object's ACL permissions when you're uploading them.
Thanks, I'll contact the owner of this bucket
hiya, it seems that catching an exception in Addressables is kinda different? I've tried to surround the statement in try catch and still got no catch exception
try {
await AddressablesManager.CatalogUpdateCheck();
} catch (Exception) {
throw;
}
What does "no catch exception" mean?
What you've written there with the catch and throw is useless code that does nothing that wasn't happening by default
whoops sorry, I mean that the try-catch doesn't catch any exception, even though it gives this OperationException when I run the editor.
The case is, I tried to disable the built-in Editor Host to simulate when player fail to check the catalog from Host, but it seems that simply surround that statement with try-catch is not working
If your code is as you've written above, you just immediately throw the exception you just caught, so nothing is changed
You're not performing any handling with it. Surely you want to do something like log the exception and perhaps return a state that says you've failed, and not re-throw the exception
i tried to replace the throw with Debug.Log and it still gives OperationException 🤔
heck, even it doesn't log anything
Is the exception coming from that code, and do you properly await your tasks all the way to the root of the async call?
I also tried to add custom exception handler to ResourceManager.ExceptionHandler, it print something on console, but the exception persist
yes, it comes from
AsyncOperationHandle<List<string>> catalogUpdateCheckHandle = Addressables.CheckForCatalogUpdates(false);
I placed the 'await' below that line
your try block isn't wrapping that code afaik?
yeah but it is inside AddressablesManager.CatalogUpdateCheck() function
should I move the try block then?
The try block needs to wrap whatever is throwing the exception, I haven't seen enough code/callstacks to really give more guidance than that
this is what i wrote
try
{
AsyncOperationHandle<List<string>> catalogUpdateCheckHandle = Addressables.CheckForCatalogUpdates(false);
await catalogUpdateCheckHandle.Task;
}
catch (Exception e)
{
Debug.Log(e);
}
and this is what I get
OperationException : CheckCatalogsOperation failed with the following errors:
RemoteProviderException : TextDataProvider : unable to load from url : http://192.168.43.70:8345/catalog_addressable-sandbox.hash
UnityWebRequest result : ConnectionError : Cannot connect to destination host
url : http://192.168.43.70:8345/catalog_addressable-sandbox.hash
What's the stack trace for that exception?
and presumably it's an actual error in the console still and not a log
yeah i think it is an actual error. I replace the e in debug.log with some string at it still appear
UnityEngine.ResourceManagement.AsyncOperations.AsyncOperationBase`1/<>c__DisplayClass57_0<System.Collections.Generic.IList`1<UnityEngine.ResourceManagement.AsyncOperations.AsyncOperationHandle>>:<add_CompletedTypeless>b__0 (UnityEngine.ResourceManagement.AsyncOperations.AsyncOperationHandle`1<System.Collections.Generic.IList`1<UnityEngine.ResourceManagement.AsyncOperations.AsyncOperationHandle>>)
DelegateList`1<UnityEngine.ResourceManagement.AsyncOperations.AsyncOperationHandle`1<System.Collections.Generic.IList`1<UnityEngine.ResourceManagement.AsyncOperations.AsyncOperationHandle>>>:Invoke (UnityEngine.ResourceManagement.AsyncOperations.AsyncOperationHandle`1<System.Collections.Generic.IList`1<UnityEngine.ResourceManagement.AsyncOperations.AsyncOperationHandle>>) (at Library/PackageCache/com.unity.addressables@1.19.19/Runtime/ResourceManager/Util/DelegateList.cs:69)
UnityEngine.ResourceManagement.AsyncOperations.AsyncOperationBase`1/<>c__DisplayClass57_0<string>:<add_CompletedTypeless>b__0 (UnityEngine.ResourceManagement.AsyncOperations.AsyncOperationHandle`1<string>)
DelegateList`1<UnityEngine.ResourceManagement.AsyncOperations.AsyncOperationHandle`1<string>>:Invoke (UnityEngine.ResourceManagement.AsyncOperations.AsyncOperationHandle`1<string>) (at Library/PackageCache/com.unity.addressables@1.19.19/Runtime/ResourceManager/Util/DelegateList.cs:69)
UnityEngine.AsyncOperation:InvokeCompletionEvent ()
That exception is hard to read, but I can't see CheckForCatalogUpdates mentioned in it?
Is that the whole stack trace?
yess that's all of it
Well, I have no idea how you're meant to catch that, but I'm kinda feeling like either you're not awaiting the whole async callstack—basically just starting an async Task method without awaiting it—or yeah, something about the way AsyncOperationHandle handles exceptions is a bit junk
Try to check catalogUpdateCheckHandle.Status after you've awaited it
okay so I tried to create custom exception handler and add that function to ResourceManager.ExceptionHandler and check the status after await
this is what i got
the game is still running tho, but i'm a bit concerned about that exception. Is it okay to let that exception unhandled?
well, at least the exception isn't halting your code and you can detect whether it happens
so it seems fine to let it happen 🤷
is it possible to Open up bundle files in the editor and use the game assets inside?
I want to allow modding for my game, so I was thinking: make bundles for my game, then modders can open the bundles inside the Unity editor and mess around with the assets packed in the bundles
I haven't tried it, but maybe this article will help
https://www.raywenderlich.com/14494028-introduction-to-modding-unity-games-with-addressables
Hmm that could work... I would need to restructure my assets though
Trying to make a build for android with local addressables but they don't appear to show up in the build. I've built the addressables (many times) and I've tried setting the 'Play Mode Script' to 'Use Existing Build' but it keeps crashing in the form of some Invalid Cast Exception with the operation handle.
Anyone else having this problem, I found a solution in the Unity forums. Apparently there's an attribute that is causing the built Addressable bundles not to make it into the build: https://forum.unity.com/threads/addressables-missing-in-build.1135357/#post-7898458
does anyone know how to rename Instantiated addressables?
here's my code:
IEnumerator test(){
AsyncOperationHandle<GameObject> testhandle= Addressables.LoadAssetAsync<GameObject>("test");
yield return testhandle;
GameObject testgo = testhandle.Result;
Instantiate(testgo,Vector3.zero,Quaternion.identity);
testgo.name="lalala";
}
but my hierarchy shows differently:
in your code, you renaming the template you Instantiating from, not the new instance
var instance = Instantiate(...);
instance.name = "Your New Name";
ohhhh ok, thanks!
i'm currently trying to set up remote content delivery in my game, and i've got the basics working, but i've got one issue.
if i designate a group's build/load paths to be remote, that group isn't included in the build, so it always needs to be downloaded when the game first starts.
instead of this, i'd like to include that group in the build, so you could theoretically start the game with no network access and be able to use it, however, i'd like the game to still check for remote updates to that group and download them if available.
anyone know how to do this? i assume it must be pretty easy since it's such a common use case, but i'm not sure how to get it to do it that way.
Hey I'm having a weird issue when loading scenes with the Addressable system
I'm using this code to unload and then load scenes
private IEnumerator Load(AssetReference _scene_reference)
{
yield return Addressables.UnloadSceneAsync(scene_Load_Handle.Result, true);
yield return new WaitForSeconds(5f);
scene_Load_Handle = SceneHelper.LoadScene(_scene_reference, true);
yield return scene_Load_Handle.WaitForCompletion();
yield return new WaitForEndOfFrame();
SceneInstance scene = scene_Load_Handle.Result;
while (!scene.Scene.isLoaded)
{
yield return null;
}
SceneHelper.SetActiveScene(scene);
yield return null;
}
When I run this coroutine the first and second time it works fine. But when I run it the third time I get an error saying the scene has already been loaded.
So I opened a unity project where everything worked the last time i opened it and now all this stuff popped up.
It all says the assets are or do have a(n) problem.. I didnt update Unity , any Asset or Visual studio(IDE i use)
In my Project are Fishnet, Probuilder and Textmeshpro and all the default assets for URP, I already tried to remove them but this all only caused even more error Messages and none dissapeared.
What should I do? Or what could have caused this?
the first error Message:
"GetLoadedImportedAssetsAndArtifactIDs called with invalid artifactID
UnityEditor.AssetDatabase:Refresh ()
Microsoft.Unity.VisualStudio.Editor.VisualStudioEditor:SyncAll () (at Library/PackageCache/com.unity.ide.visualstudio@2.0.15/Editor/VisualStudioEditor.cs:178)
UnityEditor.CodeEditorProjectSync:SyncEditorProject ()
"
Ok So based on some changes instead of the editor throwing an error now I get to the 3red scene and it is duplicated
Figured out my problem after a proper debugging of my code. Actually had nothing to do with the Addressables at. It was caused by me not unsubscribing from the events that I subscribed to 🤦♂️
Been having these errors every time I inspect some assets, if it's a scene it's guaranteed they'll popup and unity just stay there locked in the loop
is it a known issue?
Using 2022.1.13f1
And addressables 1.20.5
https://docs.unity.cn/Packages/com.unity.addressables@1.18/api/UnityEngine.AddressableAssets.Addressables.ClearDependencyCacheAsync.html
What exactly is "key"?
I'm trying to delete just some certain addressable assets
noob question; can addressables help with getting more frames for a open-world vr project that's also using HDRP?
I don't fully understand what addressables are meant for, other than getting the install base of your game to be smaller
Key is the object that you want to clear from the cache
Addressables is designed to allow loading of assets from outside your game so that content can be changed without having to change the game itself
Something like this? 🤔
To be clear
You need to unload any loaded assets first
How can I unload?
Resources.Unload
Now it says I can't convert "AssetReference" to "UnityEngine.Object", explicit casts doesn't work too 🤔
Try using Release instead. Sorry it's been a while since I did this
I tried
asset.ReleaseAsset();
and
Addressables.Release(asset);
But none seems to work :/
Sorry I'm out of thoughts. You'll need to google the error message
Ok! Thank you 🙂
I'm getting an InvalidKeyException thrown when GetDownloadSizeAsync() gets called. I'm passing in the name of a label that should be valid so I'm not sure what's going on. It only seems to be happening in iOS builds.
I have been getting "OperationException : GroupOperation failed because one of its dependencies failed" when I run my game as a Standalone OSX build.
I'm using Addressables version the lastest version (1.9.x). I've got 6 addressable groups, each containing: 1x texture, 3 prefabs, 1x scene. I build them and uploaded it to my hosting (DreamHost) via SFTP, run it behind CloudFlare, I can access those packs via SFTP and HTTPS with no issues. I can run the game and load the scene from the editor with no issues from both Asset Database or Simulation (throughout all this, I've set the hosting profile to be pointing to the remote path). However if I "Build and Run", I'm getting the above error.
Has anyone been experiencing this?
Did you change the URL after you built the bundle?
I didn't, I used the URL whilst running from editor, building the bundle, and building the game. Could changing the URL after building the bundle be a cause?
Update to this: I've only been making cloud builds for iOS thus far and apparently I need to add to my build script so that the build machine will build Addressables beforehand. I thought building the Addressables locally first and then pushing the changes to remote would work but it apparently doesn't.
noted. i'll see if there is something that I'm doing wrong in that context. Thanks
UPDATE: I've solved my problem.
I installed "Log Viewer" from the Unity Asset Store, that allows me to inspect the debug log on standalone build, which reported that it couldn't find the unitybuiltinshaders bundle, which did not get generated by the asset build. This was because none of my scenes were in the Default addressable group. As soon as I set one of the addressable groups to be the Default group, the unitybuiltinshaders bundle is generated, which solves the problem 🙂
Hope this finding helps anyone here who might be experiencing similar issue.
Should a method like Addressable.ReleaseInstance be done in an IEnumerator?
afaik ReleaseInstance only return boolean value, therefore, usual function will do just fine
https://docs.unity.cn/Packages/com.unity.addressables@1.19/api/UnityEngine.AddressableAssets.Addressables.ReleaseInstance.html
Is there a close approximation to the Resources.LoadAll?
I'm trying to move from Resources to Addressable objects, but I'm having issues with automating my spritesheet
Or should I just import the sprites one by one?
Hi. I'm using addressables to load and unload game scenes. But when I build it for Android, the colliders aren't working while there was no problem in editor. Can someone help me please. I'm using 2D
Hello, I can't build addressable because I keep getting a "AssetDatabase does not exists in the current context error" even though the script is importing from UnityEditor namespace
sounds like you have a runtime script that references UnityEditor stuff
It's on an scriptable object script 🤔
SOs are runtime scripts
if they're in your game
So I can't use things that use the Editor during runtime?
https://docs.unity3d.com/ScriptReference/UnityEditor.html
nothing in UnityEditor available in runtime
you can wrap your editor only parts with this, those parts won't be in the build, (you also have to wrap your using UnityEditor; ) ```cs
#if UNITY_EDITOR
#endif```
Hi people anyone know how to add AES encryption to adressables as mentioned here : https://www.programmersought.com/article/87778724423/ and https://ucgbucket.unitychina.cn/AssetStreaming/AddressablesCN.pdf
Addressables System Memory Save Guide and Resource Encryption, Programmer Sought, the best programmer technical posts sharing site.
or how to find that chinese package
ok found the package : "com.unity.addressables.cn": "1.0.0",
Is it worth it to batch Adressable loading into a single call (list) or having many LoadAsset at same tick is ok?
like this
How does a single LoadAssetsAsync with a list of 10 keys compare to 10 calls to LoadAssetAsync?
Slightly less garbage but otherwise very similar is what I would expect. Certainly highly unlikely to improve download or instantiation time. Combining more assets into a single build might have more of an impact there.
The advantage of loading objects in a separate calls is that you can also release the assets individually if you require this.
If you load them all at once you can only release the single handle, losing granularity over what you need and don't.
This of course heavily depends on the application of the assets you're using this in.
what is the advantage of loading all at same time?
What Timboc said. I guess only really that you have to manage a single handle, instead of multiple, which can generate a little more garbage since you probably need to keep track of them in a list.
And also depends on your use case. There's no right answer really.
If you require to everything be loaded and then continue, then loading all at once is the easiest to work with and clean up. You can be sure that everything is available to instantiate, set up, etc.
If you want to develop a system where it can already do stuff when asset X and Z are loaded, but don't need Y yet, you can do so using the multiple handle approach. It just gives more overhead for you to manage these kinds of more sophisticated systems. Or, if asset A won't be needed anymore because the player has passed a certain point in the game, you can release the handle already, and Unity may free up the memory if a garbage collection is triggered.
is there a way to choose a specific catalog to load?
For instance, if I have catalog_0.0.1 and then build the apps, the apps will recognize catalog_0.0.1 as its catalog target. But if I update the bundle and increase the version to catalog_0.0.2 without build the apps, the apps still recognize the previous catalog as its latest catalog.
I have a database that contains the latest string of catalog version that unity should load. Is it possible to tell the Addressables to load my newest catalog based on a string retrieved from my database?
If your updated bundles and catalog are uploaded to the remoteLoadPath and the parameter 'Disable Catalog Update on startup' is unchecked, Addressable will automatically detect an update as soon as you call CheckDownloadSize/DownloadDependencies/LoadAsset.
But if the parameter is checked,
You will have to manually update catalogs by calling Addressables.UpdateCatalogs which upon completion will provide you will List<IResourceLocations>, basically your list of updates.
Can we deliver a completely new shader to our user via Addressables only ? Without redoing a build ? Example : Via In app purchases, user buys a sword with a brand new shader on it. Can that user download the new shader and expect it to be working properly
You can supply a material (basically an instance of that shader) but not the shader itself since it needs to be ‘compiled’.
Anything that needs to be ‘compiled’ cannot be supplied with Addressables unless you supply the class code in any text format with the downloadable. Compile the class everytime that asset is loaded at runtime then create/instantiate object/component of that compiled class and add it to required behaviours.
With mono this is doable but am uncertain about shaders.
Though it is not recommended,specially on mobile as it takes huge amount of load.
You may find more literature here:
Though this doc is for assetbundles, But is also applicable to scriptable build pipeline upon which addressables is built.
https://docs.unity3d.com/540/Documentation/Manual/scriptsinassetbundles.html
The Unity Manual helps you learn and use the Unity engine. With the Unity engine you can create 2D and 3D games, apps and experiences.
@dusky kernel thank you for your answer. It is weird because that was exactly my assumption, that they needed to be compiled. But doesn't the addressable build compile the shaders too ? It gets through my shader preprocessor.
I also tested this after making my post :
- Make addressables build of my game
- Make the actual build of my game
- Play the game and get to scene X
- In unity, add a new gameobject with a NEW shader into scene X
- Rebuild addressables
- Go back to the player build and go to scene X
- Notice the new shader is working correctly.
It hints me that the shader variants are already compiled with the addressables and supplied in some way with the asset bundles.
What do you think about this?
Hey my fellow friends,
Is an AssetBundle built using Unity 2020.3.XX supported by Unity 2020.3.YY? Where YY > XX.
PS: I'm not updating a Major version, only a Patch version.
Non-exhaustively. An asset bundle (addressable) can contain:
Materials/Shaders/Meshes/Textures & VFX effects - these must all be compiled per platform (and in the case of vfx graph & shader graph) may need to be compiled per unity & package version too. The short version is yes, you can have a sword material as an addressable/asset bundle.*
Asset bundles cannot contain monobehaviours or c#, however they can contain 'headers' (my terminology) - a reference to a c# class that is later resolved provided that code exists in the app loading the addressable and has the same class name and possible file id too.
- as to how, that's a much longer answer but I just wanted to reassure that it is possible
Afaik this isn't very clear-cut. If the projects are using the same version of the addressables package, then mostly, yes I think it should be fine. The main caveat is that if any of your assets use VFX graph/effect - even some patch versions can ruin compatibility.
No, this wont work sorry because version upgrade will modify guids which will need a bundle rebuild
Not sure, last time we did this experiment it failed and then we came to the conclusion. Though it was long time ago. Now ig either support was provided or we messed up somewhere in experiment.
But if this works then i guess there is no problem
hmmmm, not exactly.
It is working right now. But because I have so many AssetBundles, I can't test everything. But all AssetBundles that I tested are working fine.
@mild flax Thank you for your answer ! Just to be sure, Unity compiles variant of my shaders when I build addressables and store them somewhere in the addressables build, right ? This is how a new shader can possibly work without redoing a player build. Because variant are 100% independant of any others files, iirc, as they do not reference any other files, but copy the required code when compiling
ETA : Found answer to my own question, https://forum.unity.com/threads/understanding-shaders-and-addressables.1293390/
Unmity does compile variant and store them in bundles
AssetBundles as in the old api or addressables ? Cuz addressables do change
Guids (as in associated Unity .meta files) should not change or get rebuilt unless they're eg not checked in to source control or deleted or something.
What does change (depending on your addressable settings) is what addressables calls the 'hash' file which relates to a catalogue but depending on your settings can also relate to the name of the asset
Unique bundle id's is also a setting that can affect things
I'm looking at the technical/UI design of addressables scratching my head why it is made out to be so complex. In a world aiming for less unnecessary complexity: I think I could improve it dramatically, can we discuss?: https://forum.unity.com/threads/addressables-could-be-much-more-user-friendly-i-have-a-question-on-why-wasnt-it-designed-likethis.1330005/
Such a system would also eliminate a ton of bugs, streamline workflow to avoid user bugs... And it should be plainly obvious.
Im having some trouble trying to load some assets using addressables... the assets are there on the groups window, the type I'm trying to load is correct and yet the InvalidKeyException is "thrown". Anyone know a fix for this?
var nameWithoutExtension = Path.GetFileNameWithoutExtension(textureName);
var directory = Path.GetDirectoryName(textureName);
var path = Path.Combine("data", "texture", directory, $"{nameWithoutExtension}.png").SanitizeForAddressables();
var texture = await Addressables.LoadAssetAsync<Texture2D>(path).Task;
what on earth is that folder name
does steam support a whole as a addressable for DLC
like a whole scene
I want to make DLC for 1 season which have 6 levels and challanges
does steam support it
how can I include it in my game that this season is get downloaded now show it
The og folder name uses a Korean charset, we extract that folder using another charset
It works on windows tho
how to properly load a scene? I'm currently set my scene as an Addressables and using LoadSceneAsync to load, but it seems any content in that particular scene is not loaded. UI is not showing and all of the object missing all of the shader and only showing pink colour. Any Navmesh is also not working.
Am i suppose to load all of the object manually using LoadAssetAsync after the scene loaded?
Hey guys is there a way to create AssetBundles at runtime. Like putting some objects together in the game and then creating an asset bundle out of that?
No unfortunately. Things like shaders need to be compiled per platform by the editor.
ok thanks. I'll have to look for another way to do this
How do I download assets from Google drive using addressables? Someone help me
Not sure if this is the right place to ask, but how do I see if i'm running AssetDatabase 1 or 2? The project is several years old, but has been upgraded to use Unity 2020.3.14f1 which should be using v2, but I'd like to be certain, as I'm seeing problems that make me think I'm using v1. 🤔
Is Unity Cloud Content Delivery compatible with Android App Bundle? I cant seem to make them work.
My code allocates a lot of memory due to closures...
prefab.InstantiateAsync(pos, rotation.value).Completed += handle => {
// Assign MonoEntity and the go itself to the entity :)
var manager = World.DefaultGameObjectInjectionWorld.EntityManager;
var go = handle.Result;
var monoEntity = go.GetComponent<ECSEntity>() ?? go.AddComponent<ECSEntity>();
monoEntity.Index = entity.Index;
monoEntity.EntityReference = entity;
manager.AddComponentObject(entity, go);
};
Anyway to instantiate a adressable and passing values to it WITHOUT them being allocated on the heap ?
In this case the passed "entity" gets allocated which results in a lot of gc when executed frequently...
Any help appreciated
Hi all! Has anyone faced this issue - I have been making content builds successfully in my project several times, and now suddenly today when trying to make a new content build it is getting stuck at a certain point. The content build usually takes about a minute, but now I have waited for 20 minutes, cancelled the build, cleaned the cache and retried and it's still not completing the build.
Can I use Firebase storage link to get addressables from cloud? Please help me
Hey devs, I am using addressables for my project. I want to have the game project seperate from the master project so I am using Addressables content catalog to load my game. However, I cannot add scripts to the bundle. Is there any solution for this? I want to build the project for both Android and IOS
Addressables can't add new scritps.
The best you can do is add references, but the main build must have all scripting.
Hey y'all!!
Anyone was ever, in history of Addressables, able to update remote content?
I'm able to generate new build, change the content and generate update build and works perfectly on the Editor
But my Android build NEVER updates it's content.
Even if I delete the content from the server, it will always "download" content from internal memory.
I tried deleting cache and data from my mobile, yet the remote content is there some where hidding in the shadows like a stalker.
I'm using Unity 2020.3.0f1
Addressables is 1.20.3
Here are my Addressables Settings:
How can I add references if I have some script attached to the game object. Do you mean to do gameobject.AddComponent<Type>();.Could you ellaborate?
The object that you are downloading through Addressables can have the script attached without an issue, but the script must exist in the app build.
What I meant is that you can't add new scripts throught Addressables without them existing in the pre-compiled build.
You said you want to have to separated projects, the main and the addressables one
Your main project must have all scripts, even if no gameobject have it as component
But they have to be pre-compiled on the main, while your second project can have references using "partial classes":
https://forum.unity.com/threads/how-to-use-partial-classes-in-unity.606529/
Check your remote load path on Editor
Can you make a scene addressable?
And this can be a scene that I pulled through HTTP?
definitely going to need some help here, so ive got addressables functioning from the editor with the playmode script set to use assetdatabase.
problem is that once i switch it over to use existing build/build webgl, for some reason assets are duplicated
for example, i should only have 8 assets loaded under 2 different asset label references like so (this is when using `Use AssetDatabase')
but then when i switch it over to Use Existing Build or in a webgl build this happens:
this is how the addressable addresses themselves are fetched
and this is how the addressable group looks like, i also do a default build script before running it under "use existing build"
any clue what can be causing this?
actually looks like i found something on it? looks like its specific to to LoadResourceLocations func, i specified a type and it fixed the duplicate entries issue but Ive got something else ill post shortly
figured out all of the above:
- unloading the asset and instantiating the obj while using 'use assetdatrabase' would still let the prefab function as normal and keep the references, but unloading the asset while using 'use existing build' would cause issues
- broken textures/sounds that i was getting was due to the fact that the bundle was made for webgl
I'm trying to write some tests for a system that uses addressables. I have an array of some abstract classes that can load and release arbitrary assets. I'd like to load all of them and then release all of them and then somehow assert than there aren't any leaked addressables. Is there a way to test this?
Can anyone tell me how to set the LoadPath of a BundledAssetGroupSchema created via C# using?
CreateGroup(groupName, false, false, true, null, typeof(ContentUpdateGroupSchema), typeof(BundledAssetGroupSchema));
Afaik the paths on my default object are correct (set to Remote) but when I create new Schemas this way they are set to Local.
Hi All,
Did anyone faced this problem before?
"Addressable not working in quest 2? "
And working in the editor?
for the apk size more than 1gb. or loading it from obb?
Hello all. I need some help clarifying with how to use addressables. Still new to using it so chances are I've messed up somewhere. I scripted a basic tile loading system where depending on what direction the camera is viewing, the script will call a InstantiateAsync method for a prefab of the tile to load. It will also release these instances if the camera's view direction isn't facing wherever those prefabs are instantiated.
The thing is, I'm not sure if the memory is being released. I'm looking at the profiler and noticing that when I first load the scene where only 2 of the 4 prefabs are loaded, the tracked memory 88.6/196.6MB. When I then move around a bit, load all 4 prefab tiles once and then reposition the player, such that it releases all 4 instances, I'm seeing the tracked memory increases to 131.3/258.6MB
My understanding is that if I release the memory, it should free up the memory space shouldn't it? What am I missing?
Edit: Also wanted to ask, when marking a prefab as addressable, do I need to manually set the dependencies that make up the prefab as addressable as well? i.e. the mesh, textures, materials etc
Hello there, I need to load a addressable scene with unity netcode so that it is synchronized to all clients but , I am not sure how to implement it with netcode
The networked code should take care of all things network. I doubt addressables will care either way. If you need to indicate to clients which scene to load, you can probably send some identifier that would tell clients where to load the scene from and which one(I don't remember specifically which though, I think it looks like a path by default)
is the unity addressables and CCD integration supposed to work with UCB? we keep getting errors on our side, and we can't figure it out...
Actually addressable scene cannot be added in the build settings, so how can I load the same scene for all clients? If the scene is missing from the build settings how netcode will get reference to that scene?
Hey guys, the docs are worded a little confusing: https://docs.unity3d.com/Packages/com.unity.addressables@1.20/manual/LoadingAddressableAssets.html
3. Downloads any remote AssetBundles that are required
4. Loads the AssetBundles into memory
Does this mean it downloads the entire bundle even if you request one asset inside the bundle?
Let's say I had a bundle with 100 audio clips, and only wanted one, will the aysnc download the entire bundle and then pull the asset from memory?
Addressable pretty much sidestep the build settings in that regards. You can build your game with a single root scene (happens in mobile in particular to keep store packages small). You get all scene references through addressables. It has it's own way of loading scenes, but the documentation has good examples.
Yes it downloads the entire bundle (if it didn't already earlier, or in a previous sessions). I think there is an addressable group setting that lets you package asset individually.
Just to follow up, I have levels that I only want to pull from cloud IF the user is playing on that level (I'm currently loading content in asynchronously on game start with the assets they need), should this go into one bundle or multiple?
Put each level in its own pack; that seems logical
Yeah, I'd do each level packed with all the assets the scene needs
Is it better to use addressable to load/release prefabs or scene files? I have a basic tile loading system where my tiles are prefabs. I'm not sure if it's the appropriate thing to use but it works. Just thinking what I would use a scene file for now
does anyone know if reading .json files are supported?
I'm trying to load a json file as a TextAsset and it's not seemingly finding it or even loading the key from the catalogue
Make sure you are accessing its correct property https://docs.unity3d.com/ScriptReference/TextAsset.html
Sorry for being lazy are addressables stored to the device /local storage or in memory on webgl on every bundle download?
In other words. Do I have to pull from the server every time a client loads the game?
Hello there, addressables re-downloads everything again on updating content on remote location. Can I make it to download only the changed data. Is that possible?
Hey guys, looking for some clarity on this. I am building meshfilters in an addressable group. This is loading fine but the materials and shadergraphs are being included in the build. I want all dependencies for the mesh filter to be included in the addressable group. I've the assets as addressable and included them in the group and have uploaded the bundle to CDN and included my host URL. Still being included in the build
What I doing wroooong
Hey guys, I'm working on a city builder game which most assets will be used in the late game. Do I get any benefit using addressable?
Build sizes.
hi, i'm working on a bit of code that lets you switch between loading assets from resources and via addressables and have it be as easy as possible to do the switch.
i have one issue: it looks like i have to add the file extension when loading via addressables, e.g.,
Addressables.LoadAssetAsync<AudioClip>("Assets/Audio/my-clip.mp3"). This is different from how you'd load if using Resources, e.g., Resources.Load<AudioClip("Audio/my-clip").
i know this is because Assets/Audio/my-clip.mp3 is the actual addressable asset key, and an easy solution would be to just make sure my asset keys don't contain extensions, but that solution doesn't work when i make folders addressable (instead of individual files), because then the individual file keys can't be edited anymore.
does anyone have any suggestions, or will i have to just live with it?
Morning, I have 2 dumb questions:
- Should I be loading single scenes using
Addressables.LoadSceneAsyncorSceneManager.LoadSceneAsync? (i don't understand why i would use one or the other.. are the cons or pros? for each? - In the docs, for using
Addressables.LoadSceneAsync, it shows for anAdditivescene and it's releasing it withUnloadSceneAsync, should I release scenes when changing single scenes?
Hi, I've written a helper class to handle loading and unloading of addressables, but I'm not sure if it is working correctly, as I don't see the results that I would expect (i.e. Memory goes down to the same amount after unloading than before anything was loaded). I profiled with the Memory Profiler and got the results you can see in the attached screenshot, the Event Viewer is also unloading everything correctly (i.e. the resources or any other operations are not present anymore, except for an InitializationObjectsOperation that I don't know how to get rid of, what it means or where it comes from, I'm not using Addressables.InstantiateAsync). Any idea on what I could do to figure out what's wrong? (if you need some additional information to help, let me know).
Can anyone help me figure out how to prepare addressables for a build, or what I need to do so the addressables are available locally?
We don't want to host them remotely atm.
Just have them loaded when our build runs.
At the moment when I build my application, the addressables don't seem to be part of the build.
Did you build the addressables before you built the player?
Seems like the issue only happens first run I wouldn't worry about it. Id only worry if it got larger with each subsequent load unload after the first which it doesn't appear to be
Huh, all right, maybe I'll just leave it at that for now. Think I'll do a little trial to see if the memory always increases when loading different objects, cause that would be a problem I guess, since in the screenshot I only loaded and instantiated the same prefab a few times and not multiple different prefabs.
Just came to say how absolute dogshit the Addressables system is, at least the documentation 💀
Loading 1 asset is like, 10 lines of code
Addressables.LoadAssetAsync<Material>("MyMaterial");
doesn't return a Material
That's kind of the point of an asynchronous system
You can still immediately load an object in 1 line
Keep in mind the extra memory could be from unity internals do your little test with a regular instantiate
Unity has internal allocations all over the place
And unity may clean up destroyed objects over a period of frames
This is with just the regular instantiate and it makes sense, seeing as I have to reference the prefab the normal way it's immediately loaded into memory upon application start. The remaining snapshots make sense to me as well as I'm just creating a pool and deleting it in the load and unload steps, so memory always stays the same.
I also just remembered the following from the Addressables documentation:
The Addressables system initializes itself at runtime the first time you load an Addressable or make another call to an Addressable API. Call Addressables.InitializeAsync to initialize Addressables earlier (this function does nothing if initialization has already occurred).
So the 0.3 GB that appears after loading addressables for the first time might very well be from the quote above, I'll test it out but it would make sense in conjunction with your statement about internal allocations. Thanks for your help! 🙂
€: Ok this is probably what the remaining memory that did not disappear when being loaded and unloaded is about, it was simply the addressable system being initialized. I testet it by manually initializing it before loading anything and check the memory snap shots.
Dear colleagues, I wonder if anyone heard anything new about well know issue with addressables, when they pack all shaders instead on only ones that are used, and put everything in memory on play time. I have workaround with shader scripping, but now that I added Terrain to list, the stripping dont really work correctly. maybe there is new woraround or new update that solves this problem?
Is there any method to find AddressableAssetEntry by address, for Editor extension?
Huh they don't even have a feature to prevent input duplicated addresses, really? 😅
Hey everyone. Is there a way of loading asset by GUID? I mean, instead of storing the text address us the GUID?
You can just do LoadAssetAsync<T>(guid)
or use AssetReference
You should be able to write an analyzer rule to handle this if you want
I have multiple maps that I will only load into a client once so I need to make multiple asset bundles. Is there any negative factors of having 20+ bundles (but downloading only 5)?
I suppose, but my need is to show what asset that address is pointing from editor inspector
And cannot use AssetReference for it because the string is not from Unity
No, but if they reference each other they will cascade download all of dependencies
Hi, I am loading asset using Addressables.LoadAssetAsync<GameObject> then Instantiate (not Addressable.InstantiateAsync). Should I use Addressable.ReleaseInstance(instance) method to remove instance when I need? Or Should I use Addressable.Instantiate? Can anyone describe the differences between these two instantiate methods?
Please teach me how to make not load all ***** shaders to memory when using addressables. Tried shaders collection, all documentations... tutorials.. wrote stripping code. but it is just unfair I cant handle this...
how do I specify which platforms addressables I'm building when running unity in batch mode? There doesn't seem to be a way to pass in the platform
How can I solve this? I'm trying to update from Addressables 1.20.0 to 1.20.5 (Unity 2020.3.0f1)
sure that 1.20.5 is compatible with your unity version?
from the docu it should be
So what is the best practice for sprite atlases? Should we be using the unity sprite atlas or is it better to just have a sheet we have created on our own? The issue I am having is the annoyance of referencing sprites that should be in an atlas (that is addressable) but the sprites are referenced all over. Mostly UI related
Dear people, there are good projects to learn UItoolkit, networking and etc on Unity learn. Is there a project which shows example of addressables? Documentation I read, understood and used in a project. But I want to compare other approaches, the approaches that were intended, real life examples in a project.
Is there project and content like that available?
Besides pined examples
Hey guys need some help, we're using unity UGS using ccd along with addressables package. How can we tell our cloud builds which addressables build script to use? For some reason I keep getting this error on my local builds: Unity UnityEngine.AddressableAssets.InvalidKeyException: Exception of type 'UnityEngine.AddressableAssets.InvalidKeyException' was thrown. No Location found for Key=a0f7d3d49b0e6a74484db341d269bd6e I think its that our android build is trying to use the IOS build script. not entirely sure but any help is appreciated thank you.
I understand addressable at a very high level and have limited experience with Unity. From use in code it's really easy to load addressable resource. But why, if at all, would I want to use addressables if not loading resources from code? Are there other advantages?
Anyone know how to get unity to restore the AddressablesRuntimeDataPath key which is stored in playerprefs?
If you can load recources from directory and not reference and you will not forget to unload everything, you wont get anything different pretty much.
But if you use reference directly to resources, guess what, it will be loaded to memory even if you havent loaded it on your scene. Addressables in other side will load only when you ask them to load it to memory. And furthermore the managment is way easier that doing everything manually.
How do I load a scene? I followed the tutorial and got ```cs
var sceneHandle = Addressables.LoadSceneAsync("Scenes/" + sceneName);
but it gives me the error of
UnityEngine.AddressableAssets.InvalidKeyException: Exception of type 'UnityEngine.AddressableAssets.InvalidKeyException' was thrown. No Asset found with for Key=Scenes/working_isles. Key exists as Type=UnityEditor.DefaultAsset, which is not assignable from the requested Type=UnityEngine.ResourceManagement.ResourceProviders.SceneInstance
is the "working_isles" scene marked as addressable? Also if it is, is the actual addressable name of the scene "Scenes/working_isles" ?
I have set up an AWS S3 Bucket and have set up my code to pull correctly from the server but the OBB still contains the assets im trying to pull remotely with addressables so im not actually saving any space...
I needed to use addressables to reduce the OBB size but even with the set up the OBB size is the same, not sure what im doing wrong
any help would be appreciated! : )
solved! I was still locally loading the assets which contained references to the other assets inside of them so they in turn were being loaded locally, made the parent assets a prefab and added to the addressables instead which removed them from OBB and local loading.
APKs and OBB have max size limits for most devices and publishing services. Loading from remote server allows you to bypass this by having users download data in the game itself and save locally rather than on initial download.
I think, im quite new aswell
I think so? It should be since it sees something at that path. It’s under the tag Scenes. I’ll look closer when I get home.
from what ive heard, the modding scene
if things are addressable, the mods people can make are capable of digging deeper into the game systems, could be wrong, pretty sure there was some videos covering the topic on the unity YT account
Oh yeah, speaking of, can one addressables pack's asset override another? like for modding a scene and replacing it with another
It is since it's under an addressed folder, and is called this
Hey guys. Have a simple question. Searched it but couldnt find a clear answer here.
Can i use addressables without bundling them. Cause i dont want to download all the bundle only for one asset. All of my players will need different assets according to their in-game card collections. Is this an option for CCD? Or im just gonna move on with a simple CDN..
Asking this everywhere. Any help appreciated. Thanks a lot!
To be clear. All unity tutorials are forcing me to create bundles of assets. I just wanna download images one by one if needed. Not the entire bundle for sake.
Hello I am trying to edit a asset bundle, I am adding 2 new objects into the asset bundles
A transform and a gameobject Upon trying to load it in the game it crashes without any errors so I tried loading this asset bundle in unity editor and this is the error it outputs:
https://pastebin.com/bFc1xPhn
Do you guys know what is wrong or what should I look into I spent weeks trying to get this working without any success...
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.
If you haven’t got it already. You have to use that whole address including the .unity at the end. As for versions in the group window you can add labels.
WHat do you mean by "As for versions in the group window you can add labels."
Hi guys, i'm new to addressables i have a question.. I have to export my unity app as a a library ready to be implemented in a native app. When the unity player gets launched i need the native app to send me some information on what asset to load from addressable system ( hosted on remote cloud service) How can I achieve this?
depends on which platform
Once pulled do packages save to the device? Or do they do a fetch every instance?
Look into a REST option. With S3.
i don't need them to cache on my local device, i just need a specified asset to be loaded everytime my unityplayer activity gets launched from native. The native btw should have a way of referencing the corresponding addressable to load cause i'm making a AR catalog, from the product page in native app i need to know which 3d model to load based on product the user opened
You should be using an api for this.
i had to use Trilib package from asset store. i'm gonna read the message (string url) coming from the intent that launches my unity app and then it will download the asset from a remote cloud service
but, once downloaded, does my 3d asset get destroyed and unloaded from memory when i go back to the native app closing my unityPlayer?
i don't want to put garbage on user device since the user can open different products, i just want the product to be downloaded whenever unity player (AR) gets launched from native and then delete the downloaded asset
You have access to webgl.
Also I wrote an ar app for mobile. Unity isn't the best for this unless you're dependent on libs.
Webgl. Babylon js.
oh really? nice to hear
Native qr code scanning as well. See if its your solution.
hand tracking using what? Opencv or mediapipe?
btw ty for your answers @acoustic sable 😄
ty mate
I really suggest doing this in native Web. Unless you really do need unity.
yeh, it would be much easier to retrieve assets
from native i just have to opena web browser with a specified link
and then load a certain asset from a server, like a glb
Web in general will be better for your end user. As well iOS doesn't support webgl 3.0
maybe compressed with draco and KTX
Qr codes do this natively.
Hey guys,
I am trying to learn addressable looking at the documentation.
Here is my code. It spawns a Dragon when I press a button.
But for some reason "Addressables.ReleaseInstance()" does not seems to work for me. The objects don't get destroyed. Can anyone tell me what's wrong?
I hate addressables agh I have spent 3 days working on an AssetManager!!!
GRAAHH
(That is all)
Do you know if it is possible to create an AssetReference from Addressable path ( string ) ?
Hey, have you solved this somehow?
I'm having a similar issue right now, I think. Or at least the error 😄
What I'm experiencing is that no matter how, what, who I build, I always get No Location found for Key=xxx when trying to load it. Even though it is properly released and built...
ok so, I have been having some issues figuring out a good system for loading assets with a single controlled point for managing remote assets and have came here for assistance.
Below I have a diagram with the workflow I desire. I want to use the generated catalog file and read every asset to load and cache into a bunch of asset lists that can be loaded on runtime, or even cache it on the device. I have had multiple attempts, including assetbundles, but haven't had a good way of loading from a generated catalog of items. I originally had an AssetList.txt that I manually loaded, but that would be so hard to edit in later updates. If anyone can help explain remote loading a bit better or have any good resources please let me know.
here is an example script I had made that was very simple but used AssetBundles
The main goal of this system is to load all the assets from the server on the start of the game if they have not yet been cached, or have been updated
I just haven't found any good resources for Remote Addressables
Hey all, any addressables pros online?
I'm trying to release an individual asset when loaded from LoadAssetsAsync
and passing the asset back to the Release method doesnt work
Hey, How can i get asset reference from asset path?
I need it to assign reference from editor script
installed the addressables package and got this, any idea what's going on?
disappeared when i hit clear and it runs so idk 🤷♂️
I need some legitimate insight into the use of addressables. For say a desktop game, not a distributed or resource bound mobile game, what benefit does the addressables system have over resources folder approach? Frankly it seems a lot more development overhead for not needing the benefits it provides for only downloading certain assets to save space.
Articles and references are welcome here, I would just like to know why I should move to addressables for a desktop game other than unity telling me I should for reasons that don't apply.
DLC. Also if you ever need to update the assets for some reason you wouldn't need to update the exe, just push the updated bundles
@hoary rampart is that how steam works? You write scripts to download bundles when steam asks if your game has updates? Assets don't get bundles with an exe do they?
no clue how steam does it, but I assume you can update files in your game however you want
Should I include FBX file into addressables? or it is enough to include Prefab that is made out of that FBX.
What is best practice?
To explain this question, I am not 100 % how it handles on build. Example:
I have house.FBX it have blue roof.
In my scene I create prefab of house. use mesh from house.fbx but change material to red roof instead.
In short I need only house with red roof, and I dont need everything that is inside the FBX file.
What is correct way to put this in addressables? just Prefab, and let Unity take what is needed to build asset? Or I need to add FBX as well, or it will automatically add full FBX into addressables anyways?
Main reason is I have FBX with tons of textures inside, but in my project I used simplified materials to save memory so I am afraid if I include FBX into addressables it will put all that data into package.
I think addressables is not the answer to everything, as we know. From talking to a number of other devs who launched on Steam, the sentiment was that Steam manages game updates behind the scene (if auto-update is on??) and so it's more of a seamless experience for the players because once they start the latest updated game, there is no more waiting inside the game. On the other hand, with addressables, when there is an update, when a player start the game, they'd still need to wait for the update inside the game?
I'm still learning the ropes too, but as per my current understanding:
- Including the prefab, but NOT the FBX is ok as long as you don't need to update the FBX. Essentially you can update the prefab and release an updated bundle, but it would reference to the existing FBX.
- On the other hand, including both the prefab AND the FBX gives you the ability to update both the prefab AND the FBX. Essentially you can change the house model itself, not just the material.
So if you're 100% sure that you're dead set and happy with the model (and you don't care about the textures inside), and you only rely on the material (which you probably need to make as addressable as well) and the prefab, then this might be a good way to put the FBX in the main binary, and make the addressable bundle smaller by excluding the FBX out of it.
The core question in my case is Size and Memory load. As what I need as minimum Memory usage as possible. Convenience is secondary.
Putting it into the addressable system can make it easier for automatically loading/unloading the FBX too. But I believe there is a manual way to do it yourself anyway.
Can any one help me understand why some of my Addressable groups wont work when the device is offline. Everything works fine the first time when i start the game. Addressables download and work fine from server. But when I restart game with no internet the Some Addressables wont load and simply pause the game for ever. #📦┃addressables
Did you host the addressables on a remote host?
Yes I have hosted on remote
Could it be that even when you've downloaded all the addressables, the system needs to connect to remote host to see if there is any updates? I think this might be related: https://forum.unity.com/threads/problems-with-addressables-while-offline.573976/
Actually it says it cant find the bundle. And only happens with few groups. If the groups are small it doesnt happen. I have tested it. Generally if game has downloaded the bundle once, it will not mandatorily look for it again unless its connected to internet.
I agree that's what's supposed to happen. Do you think there might be dependencies?
I have already commented on this forum link.
Yes i think there might be dependencies in some prefabs which are in the group..
DownloadDependencies do not catch this issue. That is the strange thing.
Only when we try to load it gives error.
While using addressables, on scene load my Scriptable object data gets reseted (by default it is emty, script in first scene updates values to it.). The Scriptable objects is not in addressables list, but referenced in Scene which is addressable. If play mode is Use asset database (fastest) if does not reset Scriptable object. If I use Existing build OR StandAlone, it does reset scriptable object data.
However different scriptobject does not get reseted..... Only difference that that scriptable object is on DontDestroyOnLoad object. But If I understand correctly it should not matter for scriptable objects right? as they are not destoyed on scene change anyways?
it seems it creates new instance for some reason.
For example I have a perfab with meshes from bfx, and materials from asset. I make that prefab addressable, do i need to make all the meshes and materials addressable too?
Or its smart enough to create its own instance of that mesh / material within that group
Oh you asked exactly same question I did 😄 But in short yes, it is smart enough. But it will add it in seperate group which is created automaticly. So you will not have too much control about it. It will work as intended, but not as pretty.
I personally now moving everything in groups manually and add all things I need into addressables manually. As then The "Addressables" tests will be more usefull I think.
Haha really? Honestly I dislike the testing for addressable, especially when it gets big
But it's smart enough to know whats inside is quite reassuring
That means even if i miss one or two it's not the end of the world
I really have a major problem where my Addressable groups coming from remote server are not getting cached permanently. As soon as I restart the game some groups show up corrupt and redownloads. Anyone here faced this issue?
So my game has to be online every time. Else it just stops the game.
what platform it is?
Well addressables is smart but annoying at the same time. But it is worth it anyways.
IOS and Android
If a group contains Video file or Audio files or its a small prefab it would work perfectly without internet. But i feel when the prefabs are bigger like a whole level. It will fail when the game restarts.
Checking
Yes i did this, So the problem is that Unity does not give me any error untill i try to load it. DownloadDependencies also doesnt show any issue.
I think I will try to show the error which I get in Build process
Like when running.
That would help a lot. also when you do that check Unity Editor logs for more precise data than just Unity console. You can do this test in Editor if you choose addresables to be loaded not the fastest way
aka simulating what will happen on device. (sorry mine is WebGL build so it is written webgl)
You mean i will get similar result in Editor if i use Use Existing Build?
GameController:Start()
System.Exception: Unable to load dependent bundle from location Assets/Resources_moved/The Castle.prefab
UnityEngine.ResourceManagement.AsyncOperations.AsyncOperationBase1:set_OperationException(Exception) UnityEngine.ResourceManagement.AsyncOperations.AsyncOperationBase1:Complete(TObject, Boolean, Exception, Boolean)
UnityEngine.ResourceManagement.ResourceProviders.ProvideHandle:Complete(T, Boolean, Exception)
UnityEngine.ResourceManagement.ResourceProviders.BundledAssetProvider:Provide(ProvideHandle)
UnityEngine.ResourceManagement.AsyncOperations.ProviderOperation1:Execute() UnityEngine.ResourceManagement.AsyncOperations.AsyncOperationBase1:InvokeExecute()
UnityEngine.ResourceManagement.AsyncOperations.<>c__DisplayClass57_0:<add_CompletedTypeless>b__0(AsyncOperationHandle1) System.Action1:Invoke(T)
DelegateList1:Invoke(T) UnityEngine.ResourceManagement.AsyncOperations.AsyncOperationBase1:InvokeCompletionEvent()
UnityEngine.ResourceManagement.AsyncOperations.AsyncOperationBase1:Complete(TObject, Boolean, Exception, Boolean) UnityEngine.ResourceManagement.AsyncOperations.GroupOperation:CompleteIfDependenciesComplete() UnityEngine.ResourceManagement.AsyncOperations.<>c__DisplayClass57_0:<add_CompletedTypeless>b__0(AsyncOperationHandle1)
System.Action1:Invoke(T) DelegateList1:Invoke(T)
UnityEngine.ResourceManagement.AsyncOperations.AsyncOperationBase`1:InvokeCompletionEvent()
It's behaving exactly like how it behaves on the device. When I restart the scene its giving the same error.
So now you can play with settings more actively and try to see what is the cause 🙂 sorry I cant help more than this at this moment
Thanks for showing this. I think i will soon be forced to manually download the groups in streaming assets and then let unity load it. It works 1 time and doesnt 2nd time but works 3rd time. I have made a bug report and it's pending since month now. I will see if anything fixes the issue.
Thanks again for help buddy.
So I'm using LoadAssetsAsync to load a bunch of assets, but all I get is the Unity.Object, how do I figure out the addressable name that was used to load it?
hey guys, i am kind of stuck and i am not sure what i am doing wrong. I am trying to download the updated bundles from azure but the game keeps trying to download outdated addressables instead. here's my code any help would be appreciated ```private async void Start()
{
if (clearCache)
{
Caching.ClearCache();
}
await Addressables.InitializeAsync();
List<IResourceLocator> updatedResourceLocators = await Addressables.UpdateCatalogs();
if(updatedResourceLocators != null)
{
var allKeys = updatedResourceLocators[0].Keys;
for (int i = 1; i < updatedResourceLocators.Count; i++)
{
allKeys.Append(updatedResourceLocators[i].Keys);
}
numAssetBundlesToDownload = allKeys.ToList().Count;
numDownloaded = 0;
foreach (var key in allKeys)
{
numDownloaded++;
if(ui != null)
{
ui.UpdateDownloadsText($"downloading ... {numDownloaded}/{numAssetBundlesToDownload}");
}
var keyDownloadSizeKB = BytesToKiloBytes(await Addressables.GetDownloadSizeAsync(key).Task);
if (keyDownloadSizeKB <= 0)
{
continue;
}
var keyDownloadOperation = Addressables.DownloadDependenciesAsync(key);
while (!keyDownloadOperation.IsDone)
{
await Task.Yield();
var status = keyDownloadOperation.GetDownloadStatus();
var percent = status.Percent * 100.0f;
if (ui != null)
{
ui.UpdateProgressText(percent);
}
}
}
}
SceneManager.LoadScene("Login");
}```
code is looking for 24.24 but real artifact is 46.46
yeah but shouldnt the updated catalog, tell the code to look for 46.46?
RemoteProviderException : TextDataProvider : unable to load from url : https://stemuligamestorage.blob.core.windows.net/ios/catalog_2022.11.04.23.22.29.hash
UnityWebRequest result : ProtocolError : HTTP/1.1 404 Not Found
ResponseCode : 404, Method : GET
url : https://stemuligamestorage.blob.core.windows.net/ios/catalog_2022.11.04.23.22.29.hash```
tried to clear the cache, tried checking for updates nothing works
it still keeps trying to look for the older catalog
hi there im having problem with WEBGL and addressables and caching, im since hours trying to fix it and all stuff i try so far dosnt seems to fix anything. in the player settings i disabled Data caching bool and still giving the error so its make me nuts.
the error its
Error while downloading Asset Bundle: CRC Mismatch. Provided 6b2caf2, calculated 477d6e31 from data. Will not load AssetBundle
i have try to parse the OperationException.message if contains the CRC mismatch for then call Caching.ClearCache();
but it results that you cant build webgl build with that line even if dont give error on visual studio, coz webgl now use other caching magic and there is no documentation on how to force to clear this cache...
any help please
to maybe save even 1 person from madness. here's the code i used to solve my issue
private void ClearPreviousCatalog()
{
string path = Application.persistentDataPath + "/com.unity.addressables/";
System.IO.DirectoryInfo di = new DirectoryInfo(path);
foreach (FileInfo file in di.GetFiles())
{
file.Delete();
}
}
Addressables-Localization-WebGL
Does Unity refrain from re-compiling a particular addressable group if it wasn't changed since the last time it was compiled?
Does anyone have some references to practical approaches to hybrid approaches to asset bundles? ie using bundles for scriptable object libraries.
I want to use them mainly for library or database uses and have data elements reference them since they are dynamic constructs. More of a data oriented approach.
For all scriptable I suggest reading this:
https://forum.unity.com/threads/scriptableobject-references-in-addressables.777155/#post-8280294
But in general you want all SO to be in anddressables system. You can load it at start so it would work as normally, but if they are not in the addressables you will get duplicates and etc.
@hoary stratus thanks man, I'll give it a read
The solution and even example project works fine. But I find it a bit too complicated for my taste. So I am trying to find simplier solution. If you will have good ideas drop it here. But in general everything is addressables is best solution
Regarding bundles, should the assets be organized in their addressable bundles structure? or is that more an organizational choice?
Essentially do you keep your assets organized by type (images, prefabs, scenes, etc) or by the bundle (orc battle, equipment definitions, etc) where each bundle folder has the assets for a complete prefab or logically grouped assets.
Another question I have is how granular are bundles supposed to be for them to be considered optimal, if there is such a thing?
What is the difference between Addressable Group and Asset Bundle?
Addressable is pretty much hotter Asset bundle sister 😄
Addressable group is a list of your assets which will be packed, depending on its settings separately, together or by label. S
In general I highly recommend this to research:
https://github.com/UnityTechnologies/open-project-1/tree/devlogs/4-addressable-assets
https://www.youtube.com/watch?v=XIHINtB2e1U&t=1s&ab_channel=Unity
You need to understand one thing, If you make addressable scene, all assets used will be put into that asset as well. So you Dont really need to put every single object into asset bundle. BUT! You need to plan it smartly, for example if House with specific materials is in each scene, maybe it is smart to put it into new group, so it would be loaded together with scene but separately, which will reduce loading times and download data if using remote download.
Also dont forget you can put Folders in addressables as well, for faster and easier managment. Everything in folder will be included in addressables, so if you dont need the references dirrectly you dont need to make each file addressable.
Offcourse you can make everything addressable manually, and that will be even better sometimes, as you will have full control over everything, but dont make too many groups or separate bundles, as it will give you quite big overhead in memory later on 🙂
Hello. If I import a prefab of an environment via addressable, how can I also import the baked of an occulusion area generated by the environment? Thank you.
make the scene addressable as well
If i would instantiate a house with addressable and destroy lets say a chair inside with Destroy(). Will it be a problem when I call release on the house?
Short answer is no. There will be no problems.
Long answer you destroying the chair will most likely not release memory of that chair until you unload House asset.
You can't really just release that chair if it's in one single prefab though
Unless the chair is in seperate bundle you cannot release just chair. (it depends if in your group it packed together or seperate).
As long as it doesn't say: "oh i don't see that chair in the prefab anymore i will not release it" it will ve fine
Yeah as long as it can release everything then its good enough, thanks for the clarification
In short: If things are packed together into one package, you can load one by one. But you will only can unload all package.
If it packaged separately: you can load and unload one by one. It looks better, but this will increase your Addressables management memory usage, so use it only when needed.
What i have is similar to a house, i put that as a large prefab and have a addressable group assigned to that house
Lets say it got a couple destroyable barrels in there
Once destroyed, it doesn't need to be there anymore, so i can delete it by doing destroy(gameobject), releasing scene memory
And when the player leaves the house, i will release the house prefab, this should release the addressable memory
All i had to make sure is that it can still release a modified prefab when some of the objects are missing
I personally would just disable object, as it is faster for unity to do, and it will be in your memory anyways. And unload house when it is not needed.
Really? Destroyed gameobject still remains in active scene memory?
I am like 70% sure just destroying will keep addressables loaded data in. Unless it is packed seperatly. As garbage collector does nothing there.
Well it is simple to check with memory inspector.
I know the prefab is still loaded in memory, but the instantiated objects will use active scene memory too
Emmmm? are you talking about handle? or about inniated object?
because if you talking about inniated object it just is in your memory, it does not duplicate to your memory again. It does not render but it have nothing to do with memory.
So basically i instantiate the house in my scene as a prefab. And it got 10000 barrels in it to start with
Deleting the 10000 barrel will for sure release some memory right?
I know the addressable memory wont be released before i call release on the house
But doesn't all gameobject require some bit of memory if they are present in the scene?
It will use one copy of the model; that's why sharedMesh exists.
Doesn't that only apply if static batching is enabled?
It will just remove instance data I suppose. that will reduce memory usage, but most likely you dont have 10 000 objects, and the impact of it will be quite small compared with main asset size in memory.
I mean if its the case of barrel, breaking it would mean never having to see it again, why not just destroy it instead of setting it to inactive
But each case is different. so for you destroying is better. As long you will never need to regenerate the objects.
I can pool it if i need a lot of them all the time, but once they are gone, they are gone
But if you have a lot of barrels in the house, more correct approach would have pool of them, and enable disable them from pool where character sees or by location he is. But once again, it depends on amount of barrels you have.
Does your core prefab have all barrels in it spawned already when you spawn it?
To be honest then I am not 100% sure how it will handle the memory unload when you destroy them. But one thing for sure, when you unload house reference it will be all cleaned up.
Ill do some testing now and see if it free up the memory
I think adressables is smart enough to create dependable addressable for single barrel and just duplicate it in your house as many times as you need as a profab without duplicating memory for each.
But the profiler is kinda sketch and always produce weird results especially with addressables
Please text me with the results, I will be interested in this specific situation how it interacts correctly.
are you using this?
https://docs.unity3d.com/Packages/com.unity.memoryprofiler@1.0/manual/index.html
In editor it is always hard to say for sure with memory, as it load mroe stuff than needed. however if you connect built version to profiler it can be seen quite easily.
The windows analysis one right?
This memory profiler is not directly accesable from packages folder, you will need to add it manually. But yea, if you game is on Windows platform, you build windows with autoconnect profiler function on and you will be able to capture data from actual run time.
for me addressables or not it provides precise data.
Good to know! Because in editor it's not correct at all for me
I will see how to add that with a build
Thanks again
Are asset bundles encrypted ? If someone has access to the server and downloads them, will be able to unpack them and see the models and scripts ?
Hi, it's all the week I'm tracking a strange problem that make crash my build. In the end I realized that the problem is due a GameObject that reference (even indirectly) a LocalizedString. If I set the LocalizedString reference to None, build works. It crash only if I set some string (from the inspectory btw)
Is there some way to fix this? I have read that addressables suffered some problems in previous versions.
I run the Analyzer as suggested somewhere (never used it before), but no problem has been detected
Quick question:
How should I approach this: Load asset to memory if not loaded yet?
As in one scene I might want to spawn character, and in another additive scene i want to spawn copy of it, but that is not always the case, so I want it to check if it is already in memory, if yes, then just inniate
i dont want duplications to happen.
Note: If you mark a GameObject in an Addressable loaded scene as DontDestroyOnLoad or move it to another loaded Scene and then unload your original Scene, all dependencies for your GameObject are still unloaded.
If you find yourself in that scenario there are a couple options at your disposal.
-Make the GameObject you want to be DontDestroyOnLoad a single Addressable prefab. Instantiate the prefab when you need it and then mark it as DontDestroyOnLoad.
-Before unloading the Scene that contained the GameObject you mark as DontDestroyOnLoad, call AsyncOperationHandle.Acquire() on the Scene load handle. This increases the reference count on the Scene, and keeps it and its dependencies loaded until Release is called on the acquired handle.
Could anyone give me code examplle for any of these. It seems I cant figure it out only by docs.
The first one is pretty clear, but what if I have references I made in that scene on that prefab? I would assume that scene references will not be saved in this ways, so I should copy all references, then spawn the prefab as addressable and paste all references. uff
Isn't there like callback.state or iscompleted for each of the assetreference. Also, as long as there is one thing with reference count of 1 in that entire package, the addressable group is not released. Since you want to keep it across scenes, why not just have them always loaded?
https://forum.unity.com/threads/analyse-rules-localization-asset-is-missing.1359661/
If a brave soul with knowledge on localization is feeling like helping someone, I would be grateful 😁
Hi everyone, I've run into a issue with the localization/addressables workflow.
After running analyze tool, there are a few missing tables marked with...
https://github.com/UnityTechnologies/open-project-1/tree/devlogs/4-addressable-assets
All i can suggest you to check this and how they do localization wtih addressables and scriptable objects. Sorry Can help more
And have in mind, that Analysis Errors not always needs to be fixed. This is quite weirds but it very common. I suggest clear all cache you can if it gives you problems. Also try changing this and test on editor (everything will be pink but dont mind that :D)
Is there a way to get the name/path of an AssetReference?
does exists a safe way to rebuild completely localization assets? I have an annoing error I don't know how to get rid of
when I change the locale I get this error: ArgumentException: Empty Table Reference. Must contain a Guid or Table Collection Name
it seems analyzer does not recognize this error
You mean from game object? Like you have game object you know is addressable wand you want its name?
Otherwise everything is in your addressables manager groups window.
Well I have an AddressableReference and want to know the name/path of it
I am trying to prevent hardcoding by all means possible.
Emmmm,
Here you can see the name and path, you can name it in what ever way you want. I would personally just use
https://learn.unity.com/tutorial/addressables-basic-assetreference#:~:text=public AssetReference objectToLoad%3B
Aka dirrect refernce rather than any type of string.
and just drag and drop it from editor if needed.
Lol yes I know how the inspector works with this regard. I am talking purely in code and not the editor
Addressables.LoadResourceLocationsAsync(assetReference).WaitForCompletion().First()?.PrimaryKey
Not sure why you would need it, unless you are sending it over network as string.
private async void SceneLoadComplete(AsyncOperationHandle<UnityEngine.ResourceManagement.ResourceProviders.SceneInstance> obj) {
if (obj.Status == AsyncOperationStatus.Succeeded) {
SceneManager.SetActiveScene(SceneManager.GetSceneByName(obj.Result.Scene.name));
On webgl I am having this error
ArgumentException: SceneManager.SetActiveScene failed; scene 'MySceneName1' is not loaded and therefore cannot be set active
This happens only if I unload and load same scene. If I change from MySceneName1 to MySceneName2 it works correctly. On editor it works correctly. Anyideas? Should I add extra await or something?
I have my reasons
Sorry for the delay. I saw that it is actually the scene that is addressable. But when it is added as an additive scene, it does not take the occlusion map bake with it. Do you need to set any parameters? Thank you.
Normally it should be added together with scene when you build your addressables. Make sure you are loading scene from addressables tho.
Suprisingly after changing order of loading scenes I got also problems with occlusion culling. Will inform you about results. (you cursed me :D)
https://docs.unity3d.com/Manual/occlusion-culling-scene-loading.html
Most likely because you load data additively, so you got bit weird occlusions culling.,
Just make all possible variant of your main scene and additive scenes and then bake it. And in the end load it it will work. Just tested.
any ideas why while building addressable assets this error shows up?
Library\PackageCache\com.unity.collections@2.1.0-pre.2\Unity.Collections\NativeList.cs(799,24): error CS7036: There is no argument given that corresponds to the required formal parameter 'safety' of 'NativeArray<T>.ReadOnly.ReadOnly(void*, int, ref AtomicSafetyHandle)'
using 2022.2.0b14
Hi there, not sure what cause this, i'm new to the addressables and loading my asset and spawning it works like a charm but after the spawn the object isn't clickable anymore, if i drag and drop it to scene, my raycast works on the scene object. Any idea what could cause this?
Thank you, I'll give a try.
First of all, I can confirm that spawning via addressables does not effect raycast. It works correctly at least in my project.
-
have you have any red errors on console, not nessarasy connected with this. ? AS it could interrupt spawning order and colliders are not registered.
-
When you spawn via addressables, in editor open the gameobject and try enabling dissabling colliders and check if that have any effect.
-
Check the layers your colliders are on? Maybe you have some kind of script on start which change layers?
-
Spawn via addressables and then drag and drop same prefab, check if all components are totally the same?
Thanks I will try when I’m at home this evening, but I can answer following things:
1.) No error or warning in console
3.) it’s on the default layer as the prefab and the scene objects, no script is interfering with this (just one component which holds the offsets for spawn and identify for ray)
4.) yes there are identical, it’s the same prefab/addressable, also when I drag and drop the prefab into scene when playing (so it’s get spawned, got (clone) in name) the ray cast also didn’t hit
hmmmmm. Sorry this ideas I have to check. Have you tried adding debug tool on ray cast? to check if it sees the target or and just click doesnt count? or just go right through? is raycast is on update or on some kind of function?
Yea it’s in update, I will try to draw a debug line but it should hit as I hit also the scene object (same prefab) then destroy it and spawn it again on the same position, i will post a vid or something when I’m at home
Okay. Maybe the destruction of the object does not work rather than Raycast. I wonder.
Hi everyone. I am trying to hook up Addressables and CloudBuild. I want it to still work for manual builds I do on my PC as well. I am reading through https://docs.unity.com/ccd/UnityCCDFAQ.html and this section confuses me:
How do I get my CloudBuild builds to work with Addressables?#
Add a profile specifically for Addressables. The URL needs to include “...content/?path=ServerData/[BuildTarget]”.
Are they talking about Addressable profiles here? But why does it need to include ServerData/BuildTarget (or better: Why is this not always needed?)
So, do I need a profile for manual builds and one for Cloudbuild?
hmm its a simple Destroy(GameObject), also if i don't use my code to spawn and just drag and drop the prefab while editor is running the raycast goes though https://streamable.com/fxj4d9 i made a vid here, i thought may i have to rebuild the physical scene or something when i use addressables...
this code is running in update for the raycast (sorry for the bad coding its more a prototype 😛 )
if (Input.GetMouseButtonDown(0))
{
Debug.Log("Mouse is down");
RaycastHit hitInfo = new RaycastHit();
bool hit = Physics.Raycast(_camera.ScreenPointToRay(Input.mousePosition), out hitInfo);
if (hit)
{
if (hitInfo.transform.TryGetComponent(out VehiclePart part))
{
//Vehicle Part hitted by raycast
currentPart = part;
ColorPickerHandler.currentEditIndex = currentPart.ReturnFirstMaterial();
ColorPickerHandler.Show(currentPart);
PartsPickerHandler.ShowWindow(currentPart);
}
Debug.Log("Hit " + hitInfo.transform.gameObject.name);
}
else
{
Debug.Log("No hit");
}
WEll I am using physics raycaster as well, and colliders on objects. Yet it seems to working correctly. I am thinking it is more something with setting up things. Like object missing collider or layer is set to something incorrect. You are able to click on object on editor right?
turn on gizmos and check if there is all colliders active
Yes there are in place and active i think its not addressable related and i should switch the channel, as i'm very new to addressables i thought i did something wrong with these setup, thanks for your help!
Does Addressables loads scenes faster and smoother (without stutter) than regular built-in one?
It's not clear to me why it doesn't work. Initially I have an empty scene with no occlusion area. Then I add additively a scene with the environment and its occlusion area. If I do this, I am told that the map has not been baked and therefore does not work. If, on the other hand, I create a baked map of the first scene and then add the second scene additively, the second map is not added in the baked and therefore it does not work. I can't swap the loading order of the scenes.
https://docs.unity3d.com/Manual/occlusion-culling-scene-loading.html
Occlusion culling is not very smart, it loads not by the scene, but by active scene. Also it can load combinations of scenes, but to do that you actually need to go to editor, manually load them, then bake. and then when you load same active scene and add the extra scene, it will be able to see the occlusion culling of that scene
Depends on your implementation. Normal scene can load scenes async mode just same as addressable, so you can avoid the stuttering. Addressables default loading is async so you will see less stuttering than default sync load. Also you can preload scene into memory while doing something and add it quicly when needewd
turning on "Read/Write Enable" options on the target fbx might fix it. It is not performance friendly method tho. Could you share your spawning code as well maybe? is there any other coliders that could block raycast?
I was talking about async loading in both scenarios, so Addressables loads at the same speed. Turns out the stuttering was because the editor cannot handle async loading, it only works stutter free in builds. Does this happen with Addressables too? Async only working in builds?
I am pretty sure they use the same loading for scenes. So you wont see differences there. Only difference you can preload during gameplay to not notice it and etc. But depends on your code and machine there might be stuttering. Anyways I always suggest to use addressables anyways, so you will lose nothing.
You can kinda preload with built in too, by disabling sceneActivation of additive scene and enabling when you need to activate the scene.
That is correct. Thats why I am saysing it uses same logic on that so you wont be winning anything there.
so ive currently got a scriptableobject which has an associated unique id, and im currently trying to load its contents via the addressables system
i want to load some addressable via this associated unique id, but to do so im finding that I first have to load all of these scriptableobjects at runtime, assign each id an addressable resourcelocation primary key, then unload them all at game start so i dont have to load and iterate all of these scriptableobjects when i attempt to load it later on via the unique id
is there a better way that I can achieve this?
the reason im using a unique id per scriptableobject atm is because we store this id on a server atm to determine whether youve unlocked something or not
so we dont really have the option of caching the addresable load path or anything (on the server i mean)
my current solution is something like this:
also another question regarding addressables, that same scriptableobject i was talking about earlier actually contains a sprite, and i presumed that once i unloaded the addressable itd unload the sprite too, but surprisingly the sprite is still loaded afterwards. is this intended behavior? i know for sure that the loaded scriptableobject is being unloaded since the event viewer shows that it is being unloaded, but the sprite that the SO had in one of its serialized fields seems to be fine
Hey at all, we are facing some serious Addressables and Shader problems and are not able to get it solved by ourself. In our opinion it seems to be a unity bug.
Short explanation to our app: It’s a property/house configurator. The app ships without any content and the user can download a house by a code. This house was set up as a scene in unity and build into an addressable. This addressable will be download and the containing scene will be opened by our app. At the moment we are working with Unity 2020.3.16f1. All our house-addressables were built in this version, too. At the moment we are hosting around 1k houses.
Now we would like to update the unity version without losing backwards compatibility to our already build houses.
We tried some Unity 2022.1 Versions which kind of works well with “just” some problems with transparent textures on iOS (build only, not in editor):
Left side: Both App and Addressables build in 2020.1.16f1
Right side: Addressables build in 2020.1.16f1, App build in 2022.1
To track this bug down, I made a simple test scene with just two of these broken materials. I build it as an addressable in 2020.3 and load it in our app. And… It worked… no problems with transparency… So I tried a normal house addressable and it worked, too. So when I first load the small test scene and the open a realistic bigger scene in one session, we don’t have any issues in both scenes. Its also possible to load the big scene twice, to fix the problem. Just if it is the first scene which is loaded we have the shader problems.
For me it looks like that the shaders are not loaded completely in the big addressable, and some passes are missing. But when it once loaded completely it will work for every addressable in this session.
For this post I made a small test project which just can load the small test addressable and a bigger house addressable. Unfortunately with this test project both addressables are working fine in Unity 2022.1. So it possible that we have some more overhead in our app which blocks the loading of the shaders. But we don’t touch the materials at all in the loading process.
Since I wasn’t able to track the bug further down and I spend way too much time, I just tried our app in Unity 2023.1. And… same bug as in Unity 2022.1, but it is way better reproducable, since the small testing scene also don’t work anymore, even in my small test project.
For us it would be totally fine If we get it running in Unity 2023.1, but I think it might be the same bug in both versions.
We can send out a test project with the small test scene, where you should be able to reproduce the bug in 2023.1 on iOS (on device).
It just got one button “Small Test Scene”. On pressing one of the buttons the app will start downloading the addressable and the load the containing scene. The small scene is less than 2mb and should load in less than 10 seconds.
Top, right appearance in 2020.3. Bottom, wrong appearance in 2023.1.
We also already made a bug report: CASE IN-23881. Any Help or possible short term solutions would be greatly appreciated!
The fact that the problem disappears if you load the scene twice points either at a bug in addressable (if so, don't update :/), a racing condition or resources not being entirely packed in the same addressable group than the scene. It's possible some dependant resources only start downloading when the scene is open if they are in another group and when you reload the scene unity can find them already cached from the previous load and the shader work correctly.
Just where I would look
Thanks for the advice. Not updating unity or updating the addressables is not an option for us. This is about the same direction we were thinking. Do you think there is any way we could reload the shaders once we are in the scene. That would work as a temporary fix in 2022.1 but not in 2023.1.
To add to the above this diagram shows the sequence of opening addressables/scenes for 2022.1. This does not work at all in 2023.1. There the shader problems stay consistent all the time on all kind of addressables
I wonder if it's something like e.g. the standard shader has changed in Unity versions. In your main app, it's shipping with these shaders (whereas in your simple test, there aren't any other scenes using it). Then when it attempts to resolve the shaders downloaded with the addressable asset, it finds the existing ones in the app and uses that but the settings fail to deserialize properly. Just an idea. If that was the case, not sure what could be done about it other than avoiding eg using the same shaders in the rest of the project. Completely guessing - might not be to do with that at all.
Hey! Is there a way to add new "Scenes" to addressables saved on a cdn and have them show up and be loadable at runtime without updating the build?
So not just for updating existing assets but adding new assets
does anyone know how i extract addressables to each seperate bundle?
when i export these to an asset bundle, the container stays as "/assets/data..." when it should be the addressables
anyone?
If you select Default Local Group I think you want to look for the setting that says something like 'Pack individual assets separately'
This setting
ohh thank you
but the thing is how do i actually create the bundles? like have them as a file
Are you looking for this?
well i do click that but i cant see the bundles anywhere
like, i want the asset bundles as file
like how you extract assetbundles?
I think by default they're placed in a ServerData folder next to your Assets folder but this also depends on your build path in your addressable settings
where 😭
look in explorer, not in the project window
what is your Profiles->LocalBuildPath set to?
sorry but wheres profiles 😭
Is there a way of using the addressables api from outside unity? for a custom patcher specifically
why isn't there an option to name assetbundle containers after addressable names?
I finally got annoyed enough to make a plugin to remind me that im using prebuilt addressables in playmode!
I just kept on forgetting https://github.com/MrBinaryCats/ForgettableAddressable
is it ok to use adressables inside a package?
I got SciptTemplates inside my package that i reference with adressables. how would i distribute that package like this?
i think what i am asking is how i get an adressable group asset inside my package?
sorry very new to this...
okay i think i found what i needed to know:
https://forum.unity.com/threads/addressables-usage-within-a-package.1063016/
seems like there is not really a good solution right now... i should probably get rid of the use of Adressables in my Package
Is there a third option here. Trying to make it so my project detects new scenes added to the server and downloads them as needed.
(1) One Big Bundle, loaded when app first starts in scene, dynamic list populated with name of each scene in bundle, and you can load whatever scene you pick
Pros: Easier to manage, whenever a scene is added to the bundle, the list will update dynamically.
Cons: BIG download on application start, you are downloading everything vs what you need
(2) A text filed containing the file paths of the bundles in question on the server, populate the ui dynamic list with the scene names, and download them dynamically when selected.
Pros: Smaller file size
Cons: Have to manually put in scene names in a text file on your server.
Is there a middle ground method I’m missing?
can someone actually help me
like i asked this in dozens of different servers
I'd make a simple json endpoint on a web server listing all the available bundles and having descriptions, links to image, links to individual asset bundles. Each scene is a separate bundle.
you could also make it a little smarter - by having the client provide a date from which it had last seen the information and the server only providing new data to the client based on that date.
Would updatecatalog also do this?
Thanks btw!
There is a way to Unload the Addressables in a different script?
I'm loading the addressables in the first script (First Image)
And I want to unload in a different (Second Image)
Is it possible?
I’d say use: public/private >Scriptname< name so you can call the name in that script
Hope it works
Or do you mean the instantiate? Then u could always use Gameobject.Destroy() i think
I have a json based representation of my game's levels (grid based, local single player game). I'm considering loading all prefabs in an asset bundle, and instantiating them at runtime. Is this a bad idea? The other option would be to somehow automatically make a unity scene or prefab for each level I guess
Maybe I should put everything in Resources instead?
Nm I got some help elsewhere
hello. I have this strange issue - I am loading from my server an asset bundle, and on Windows it works, but it doesnt on Android.
bundle = AssetBundle.LoadFromMemory( archedFile );
on Windows return the bundle, while on Android returns null
what is the issue ?
obviously your archedFile is null or byte[0]. perhaps you can show how you fill archedFile
Hello everyone. Is it possible to cache "play mode loaded scene" into SceneInstance (UnloadAsync can work with ScenInstance or handle of SceneInstance) somehow? Trying to make additive scene workflow and I need to unload playmode scene somehow, but feels like i will need to use SceneManager class
There is a way to load via addressables.LoadSceneAsync after play mode entered but I don't like this duplication process XD
please, help! any idea if it is possible to combine multiple PhysicsScene into a single one?
hi i'm working on a project that i need to get list of all resouces with any of 2 or 3 labels
so i use LoadResourceLocationsAsync to get a list of locations and it works exactly as it should in the editor
but when i build the game as an apk it randomly skips 1 or 2 labels sometimes
i'm using unity 2021.3.8f1 and addressables 1.19.19
I am still having trouble how addressable works. How can I get my clients download the content of addressable from the internet?
Thanks!
Unity's addressable system keeps giving me an invalid key error, saying that the key/address doesn't exist when I try to load something despite me already marking the target's folder as addressable and giving it the correct address. Is there something I'm doing wrong? I'm also loading synchronously (I know it's bad but I need to load this thing immediately) 
I just tried it with async loading but that also seems to have given me an invalid key error, so I don't think it's due to using the obsolete tagged synchronous API
If I reload a Addressables.LoadAssetAsync.... Will it auto load and not take up 2 memory places?
Check if you have duplicate addresses lying around
Is this in runtime or editor? What is your addressable package set to (if its in editor)
I don't seem to have any duplicate addresses but the entries within the addressable-enabled folders seem to have their names grey in the groups window, that's normal right?
the play mode script thing seems to be set to Use Asset Database but I think that's the default
when try using an AssetReference that's been assigned in the editor, it still gives me a invalid key error but it says the invalid key was some kind of long ID rather then the string address I was using before
wait, I just tried loading a sprite with the same string address method and it didn't give me an error. I've been trying to load a scriptableobject in the previous attempts, are you unable to load those with addressables?
just tested actually using the loaded sprite and it doesn't seem to work when using the obsolete tagged synchronous API, although it did work when I tried using the async API.
Is there a way to make async more code 'clean'? One thing I like to do for loading stuff is making all calls have to go through one static class script but that seems much messier with async, is there a way I can pass whole onComplete and OnFail functions to these other functions? Sorry for being a C# noob just not used to having to deal with this async stuff
still can't load my scriptableobject but figured I should probably deal with this in the mean time
hmmm, I'm reading on forum posts and stuff that addressables really don't play nice with scriptableobjects, should I just use a different asset loading system if I want to load scriptable objects?
The system I used for some of my other projects seemed to work fine.
It play perfectly nice with Scriptable objects. And even give you more control over how to use them. BUT you need to make preparations with it. If you want to use scriptable objects with addressables EVERYTHING needs to be from addressable systems. Reason is instances.
Example: there is reference scriptable object in scene A. Scene A is in SceneManager and in scene list of unity. Then there is Scene B, which is fully in adrressables list. Scene B uses same scriptable object. But when you will load Scene A and then Scene B, you will notice that scriptable object have two instances that share only default settings. Solution for this, load scripable objects from addressables or make all scenes to load from addressables.
In my case I needed rework quite a lot of project to load everything from addressables, but after that there is no problems and I can continue working as I used to.
--------------------------------------------------------------
Anyone have luck implementing dynamic shader loading with addressables?
https://forum.unity.com/threads/dynamic-shader-variant-loading.1339160/
Hey, I'm using addressables to load an image asset when selected in a list. The problem I'm having (and I could be using addressables completely wrong here) is that when I load the first image and then load the second image, I release the first one but then if the user goes back to the previous one, I get an error saying that the asset was already previously loaded. How could I solve this?
Depends on your asset group. If your asset group is "packed together" then you can load in memory one by one, but unloading can be done of all asset group. For that you can use "packed separately" or "packed by label", then you will be able unload one by one or by label. But this will leave bigger memory trace of addressable.
Next thing is to keep the list of handles when you load image. And before going back just check if handle is ready and completed, and then if not load again. If it completed just use the result of the handle.
So in short: make a list of handles or check if the reference is not null before using it.
Unity example doesn't provide me a better way to use Addressables.LoadSceneAsync without a string... How could I make a Scene addressable?
the string is just the addressable address. How else would you load it?
AssetReference? Trying this out.
Ok so... AssetReference works, but how could I safeguard to use only Scene type?
doesn't it return a sceneinstance? probably throws an error otherwise
Well I thought I could just .SetActive(true) on scene object, but that doesn't seem possible...
Would I just cheat this by rendering the entire scene from a different camera mask?
what are you actually trying to do
From main menu, load a scene async in the background until the scene complete, the jump into the level like there's no loading bar.
Wanted to just "disable" main menu scene, and use that in case the player decided to quit the game.
Also is it possible to retrieve the progress of scene loading?
AsyncOperationHandle has a PercentComplete property
Not sure if what I've explain helps illustrate what I'm trying to do?
just seems like a matter of managing your additively loaded scenes at that point
Hello, I'm trying to get my WebGL build to work, but I'm getting this error:
Error while downloading Asset Bundle: Failed to decompress data for the AssetBundle
The code how I load them:
// Awake
Addressables.UpdateCatalogs(true, null, true);
// During the game
AsyncOperationHandle<SceneInstance> handle = Addressables.LoadSceneAsync(path, loadSceneMode, activateOnLoad);
// Wait for assets to load before using them
Hello I m trying to get my WebGL build
Anyone have any insights on delivering scripts (compiled .net binaries or lua code) via addresables ?
Im currently looking into it and either option is valid but requires extreme care in designing the deliverable codebase as the binaries should not depend on build code in anyway (as far as my assumption is concerned) but enlighten if im incorrect.
lua kinda solves this problem as it is seen as seperate layer and its expected by programmer for boundary maintenance via moonsharp but im not sure if addressables go hand in had with lua (moonsharp api preferrably). Any insights into this is welcome.
Goal is to supply code via addressable package along with assets.
Since the lua script is basically just a text file that is loaded at runtime there is nothing special to do there afaik. No ide aabout .net binaries
Cool, thanks for read though
not a problem. a .Net dll is just a byte[], a runtime dll can be created from a byte[]. you just need to use reflection to access it
and, btw, your assumption is incorrect
RemoteProviderException : Unable to load asset bundle from : http://127.0.0.1:57808/WebGL/game_assets_campaign_157d847fb79ddc23a96b9c2bbd0ee55e.bundle
UnityWebRequest result : DataProcessingError : Data Processing Error, see Download Handler error : Failed to decompress data for the AssetBundle 'http://127.0.0.1:57808/WebGL/game_assets_campaign_157d847fb79ddc23a96b9c2bbd0ee55e.bundle'.
ResponseCode : 200, Method : GET
url : http://127.0.0.1:57808/WebGL/game_assets_campaign_157d847fb79ddc23a96b9c2bbd0ee55e.bundle
my bundle had been downloaded but addressable couldn't load it in Webgl. i've been search but no result for this issue. Need help
Tried that and got it working partially. Still there are few things I wanna know are doable or not.
Prefab 'A' has Script 'A' and 'A' is also in .net dll. Prefab 'A' is marked as Addressable asset. and the .net dll is packed as TextAsset in Addressable too, making it deliverable.
Now Script 'A' will be present in built apk, and will be present in binary too.
Any idea how to 'prevent' it from being included in APK ?
Well the obvious way is to set the inspector of the dll not to include it in the platform. As long as nothing in the build is using it then there should not be a problem
Check the Build Target of your Bundle
https://docs.unity3d.com/Manual/AssetBundles-Building.html
downloading Asset Bundle: Failed to decompress data for the AssetBundle
Okay, I have the same issue as Lasse 
this is my current config for each package assets
Is the addressables GUID equal to the AssetDatabase GUID of an asset?
You can use either the addressable's name, or the asset's GUID to "find" the object
Hello , I am new to addressable is there a to check if the complete group is downloaded or not?
Hey guys, I need some help please. I'm downloading an AssetBundle from AWS but when I use
AssetBundle.LoadFromMemery(byteArray) I get the error - 'Failed to decompress data from Asset Bundle 'Memory'.
Please help I've been stuck with this for a while.
Are there any obvious reasons as to why the aa/settings.json file isn't being built?
It works fine locally but when building via TeamCity it doesn't seem to build.
I have settings.json in com.unity.addressables\aa\Windows but not in my final output build _DATA files.
@me if you have any info
I'm still confused, how can I reference the object after I called .ActivateAsync()? Using Addressables.LoadSceneAsync() method.
wouldn't you already have the reference from LoadSceneAsync?
Sorry, I meant the Scene....
yeah, you can get the scene reference from LoadSceneAsync
I'm still confused, how can I destroy the scene then? All I got was AsyncOperationHandle<SceneInstance> datatype?
E.g. I want to destroy the main menu scene because I should be playing in a level scene.
the result of the asyncOperationHandle gives you a sceneInstance which you can use to access the scene. If you just want to unload it then use UnloadSceneAsync
What about reloading the same scene? I.e. user wants to restart the level?
You'll have to unload and call LoadSceneAsync again I think
Hi! Is it possible to load an additive scene with some scripts attached to objects? Is there a way to simulate this functionality? Maybe using a dll or reflection? Thank you.
Hello addressable wizards, I'm looking for help with a seemingly simple setup..!
It seems once addressables are initialised and remote catalogs are updated there is no way to fetch further updates without restarting the game.
Looking through the logs, the culprit seems to be that the addressable system thinks the remote hash (cached after initialisation/initial uodate?) Matches the local hash, so it doesn't attempt to update the data .
There seems to be no way to clear this (in memory) caching of the hashes and forcing the system to check again.
The setup is simple. Here is my initialisation process:
- Initialise addressables (remote Catalog update disabled)
- check for Catalog updates
- if there is an update, download it
- check download size for all keys
- download all missing keys after prompting user ("15mb update available")
- good to go!
The problem arises if I try to run this process twice in one session.
- Initialise process
- remote Catalog and bundles updates
- custom logic to detect change while game is running..
- in response, my app flow returns user to start screen
- execute initialise process again..
- no Catalog updates found. Nothing to download...!!
If we restart the application...
All works well. New update is detected, changes downloaded
This feels like a pretty typical setup for ie mobile games. I'm sure im missing something simple!
Addressable has auto check for remote content update set somewhere in addressable setting, so it will check once when addressable is getting initialized, api is public https://docs.unity3d.com/Packages/com.unity.addressables@1.15/manual/UpdateCatalogs.html
Hey thanks for response!
Ok so brace yourself: this is where it gets fun...!
That setting only happens on Init, which has internal checks to make sure it won't run again..! (This is the Update Remote Catalogs On Startup checkbox)
The UpdateCatalog method has a similar problem. It caches the remote hash of that Catalog in-memory for the duration of the session. Consecutive calls to UpdateCatalog do nothing.
So to elaborate further...
-
Disable UpdateRemoteCatalog checkbox so we can control the entire update process...
-
Launch game. On launch, after init, call UpdateCatalog.
-
Catalogs will update if there is an update
-
Some time later, we update the remote bundles
-
Call UodateCatalogs again and it will do nothing.
Enabling addressables logs (precompiler directive; I think ADDRESSABLE_LOGS) hints at the problem: the remote hash value supposedly matches the local one. It doesn't even attempt to ping the remote hash file to see if it has changed. It only pings for it on UpdateCatalogs if the RemoteHash is not yet known, and then it caches it for the rest of the session...! This blocks all future UpdateCatalog calls from actually checking if the bundle has changed. 😵💫
how can i fix a error in addressables that shouldnt exist, but unity seems to keep complaining about a build option that isnt there
shes in 2019 with default build to pc, but the addressables is complainging about xbox
delete the packagecache folder and reopen the project
you can check the download size of the group. If it equals to zero, that means all cached.
Hello, i'm quite interested to learn about game development and i wish to download Unity to find out if i like being a programmer, but i have an issue that doesn't let me open unity hub, and appears this on my screen, it is in spanish though, but it says: "The "Unity Hub.exe" item referenced by this shortcut was changed or moved, so the shortcut will not work correctly."
What should i do?
how on earth did you end up asking this question in this channel
Wait, was i supposed not to ?
this has nothing to do with addressables, so no
Oh... Well, where am I supposed to?
go to #💻┃unity-talk, but otherwise just open the hub using the start menu or something, you don't need the shortcut
can you create an addressable at runtime to store mesh? as a save/load mechanism for user content made in the game
no, thats not the point of addressables
Trying to do the same thing (save/load usermade content to webserver). Holler if you find a good way to do it.
what kind of content do the user create
is it more of customization so its some text and floats or binary data like texture
for text and stuff using JSON to transfer the data should be fine and for binary data you could either upload just a encoded image (PNG) or transfer it after you converted it to base64
It's supposed to be a level editor that allows for users to create a level and for other players to play them (think Mario maker on a much, much more basic level). One thing I've been considering is storing the 3D models in assetbundles or whatever is viable on a webserver, then use a JSON serialized EditorObjects class containing variables for type of object, as well as data for position, rotation and scale. Other than that, might have some boxes to show text from a narrative tree but nothing spectacular gameplay wise.
Saving content is one thing too, but I haven't been able to find many resources that could help me out with making the level editor.
I'd love to find out more here as well. I created an editor for my game which is a plugin for Unity. This way I can easily create addressables out of what the user creates and upload them to my server. At runtime this is a totally different endeavour. I have not even brainstormed it yet but maybe it's something along the lines of exporting the model as an FBX and the components through some custom serialization/save system. Ideas welcome!
Hey, is anyone else getting this error when trying to build with addressables? "NullReferenceException: Object reference not set to an instance of an object
UnityEditor.AddressableAssets.GUI.AddressableAssetsSettingsGroupEditor.TopToolbar (UnityEngine.Rect toolbarPos)"
It stops from doing any type of Addressables builds...
Seems some default schemas had no script attached to them and I don't know why...I deleted them and it seems to work now...
I went on and deleted the entire addressables settings folder to start new and received a WHOLE bunch of these warnings!
Here is one missing the script:
Heya! So, this might actually have more to do with UnityWebRequest, but has anyone else had issues downloading remote bundles in WebGL with the latest 2021 LTS versions (specifically 2021.3.15/16)? I upgraded from 2021.3.14 because there was a WebGL specific fix to UnityWebRequest, but after upgrading, bundles almost always fail to decompress when using DownloadDependenciesAsync or UnityWebRequestAssetBundle. Although Addressables.LoadSceneAsync seems to still work, for whatever reason, and they download fine in the editor.
Hello, I am relatively new to Addressables, is it possible to get a collection of instances?
[SerializeField] AssetRefrenceT<GameObject> Refrence;
async void Start() {
for (int i = 0; i < 5; i++)
await Refrence.InstantiateAsync(Vector3.up * i, Quaternion.identity).Task;
Debug.Log("Done");
// Is it possible to do something similiar to the code below
foreach (GameObject go in Refrence.Instances) // AssetRefrence does not have Instances field
Debug.Log(go.name);
}
will doing Addressables.LoadAssetAsync second time with a same asset but in a different script, skip the loading and use already loaded asset instead?
Should be that way, because Addressables should keep track of the AssetReference
Hey guys, I have an issue with Addressable Bundles and it's driving me nuts 🥜
I have an addressable folder containing 2000 images for one of my scenes. But it's included (sometimes multiple times) in builds for my other scenes (which do not use these images anywhere)
How do I stop it from including all my adressables? I started using these instead of the resource folder for this reason 🥹 Please help 🙏
My images are all under the "default" group. I'm sensing this group might be loaded all the time no matter if the asset is used or not or something.
I am not sure I am getting you right. The addressables are included in builds because you set them up. No matter the scene you are exporting afaik. Its not very common to build different scenes as theoretically a different application, thats why they should get included as a build of your project
I understand it's not super common but in my case all "games" share many of the scripts and resources needed (museum workshops) so it was a lot simpler for me to use scenes rather than entire projects (also easier for version control)
I was hoping that unity would look at what assets are used in which scene and only import the required assets for this scene (like any other assets do) with the exception of the resources folder always being included.
But I understand now that Unity doesn't read my code of course and thus cannot tell where in which script (and thus scene) I call the load method for those assets so you have to manually "include" or not in the build the addressables. This makes sense to me.
My second question then is, what is the difference between a Addressables.Load (with assets present locally (not remote)) and resources.load ? Is there an advantage to keep using adressables?
I suppose in my case it' better because I cannot tell unity to not load a specific folder in the resources folder in a tick of a box
Other question, whats the issue with the addressables being inside the build?
Resources.Load takes in everything from the Folder /Resources/ if you created one. its totally different to Addressables approach
To explain the issue (but I'm okay with just un-ticking the include in build for scene that don't need it so it doesn't matter anymore):
I have a scene "Pangea" that shows you a slider that flipbooks through 2000 images of the Earth during Pangea
I have other scenes with other minigames about earthquakes etc...
I build Pangea and put it on one computer in the museum, then I build the other one etc...
But I don't want my other minigames to have the addressable assets of the Pangea build
So I thought Unity would realize (but I know now why id wouldn't) that the images assets used in the Pangea scene aren't used in the builds for the other minigame sand thus not include them
Why dont you create like one build for everything? And have like a selection scene to select from the actual scene you wanna load. So you do not need to build 10 different builds?
because each game will be running in fullscreen "demo mode" in windows on a different computer each (imagine a bunch of minigames in a museum about earthquakes)
so a "selection menu" isn't an option
The games are running on crappy mini computers with very limited hardware
Well, its just a file as long as you do not load any addressable, so, hardware is not an issue. And the selection screen is just for the person to set them up once. As soon as they loaded their Scene, they will be stuck in that scene anyway
When using a Unity using Addressable downloads the data from the remote server where it is downloaded and save on the client side?
I can't build Addressable assets because my text file has the extension .tmx (the Tiled map editor file format)
I click "ignore unsupported types in the Adressables settings, and it builds, but now a request for loading that file fails even though the key/path is correct, I assume it's still failing because it doesn't like the extension.
Can't I just designate certain extensions as a specific asset type?
if you click that box that file just won't be built, so you won't be able to load it at all. Does it really need to be addressable?
Not sure how else to load assets on Nintendo Switch. AFAIK that's the only way, to make it Addressable
My whole game is built around using addressables already so it would be trivial to include this into the system but I'm being blocked by an arbitrary restriction of it not liking what 3 letters are on the end of the file name...
You can create a ScriptedImporter to import the file into an asset
And then Addressables will use that asset
This sounds very useful, I assume I can just have it copy the entire file and rename it to .txt?
Create a TextAsset from it, and then you can load the TextAsset through Addressables
I just got done making a ScriptedImporter that uses System.IO.File.Copy to just copy the file with a .txt extension and it seems to work perfectly 🙂
Thank you so much for your help.
This isn't an addressables question
Hey all, I just wanted to ask if anyone knows if it's possible to load in assets from a URL without it being an assetbundle/addressable?
i.e just an .fbx file and have it being added as a mesh in game
by using web requests, yes, but you'll need to have your own fbx importer to display it as a mesh
Thanks for the quick answer. I will look into this 🙂
Hi, I am loading asset bundles of scenes in my game. Now I tried adding translation to english and spanish in that scene using the localization package, but when I load the asset bundle of the scene the texts are missing. Do I need to do a separate asset bundle for the localization tables or what do I need to do?
Hi there! I'm creating an editor script that creates addressables automatically from FBX files, the problem is that I cannot reference the textures to the materials so when I try to load the addressable, the model loads without textures.
I have tried using ModelImporter.ExtractTextures and some AssetPostprocessor, such as OnPreprocesMaterialDescription, but none of these seems to work.
Any advice?
What did the extracttextures give you tho? as you said, not seems to work?
It does extract the textures in a folder, but with no references to the material or the model, so they remains white, it seems like the default material in Unity. I don't know if I'm missing a step or something.
ExtractMaterials is not working eiher?
or do you just get empty materials and textures without context?
Hey! Is there a way to limit the time async addressable loading spends on the main thread per frame? Application.backgroundLoadingPriority doesn't affect it, which is something that worked with the old Resources system.
You sure its in the main thread? I thought addressables is async and aside the main or is it just async?
i'm not sure if it's directly done by adressables, or is it a side effect, but this is what hogs the main thread:
which renders the system unusable for loading additional content without fading out player's camera
Do you just load the addressables or instantiate them async?
Hm, weird it does that when not being used. but as I said, I was assuming addressables is doing that. Are you loading async or just loading?
i'm using LoadAssetAsync
Might be a bug tho from forums posts. maybe also a editor thing, because it loads them on the fly without prebuild the bundle
Yes, I'm getting empty materials and textures without context, though I could not find ExtractMaterials, I've been using materials = AssetDatabase.LoadAllAssetsAtPath(importer.assetPath).Where(x => x.GetType() == typeof(Material)).ToArray(); to get the materials
Did you try extractasset on the material?
Hi I am loading asset bundles of scenes
the profiler capture comes from an android build - same thing happens in editor, too
Yes
And I get this, though the textures ares exported, they're not referenced
so, the issue lies not within the addressables system
addressables load the asset just fine without hitching, and do that very quickly
the problem starts when unity wants copy the loaded data, that happens entirely on the main thread, and - to my knowledge - there's no option of regulating this process
so my frames just hit the floor for a moment, which is not very pleasant in a VR game
you can just throw it to another thread tho
do your stuff inside a separate Task.Run() and on Complete, use the built in callback to handle your stuff
i don't think so - i am doing nothing apart from loading the thing
{
var sw = Stopwatch.StartNew();
var op1 = Asset.LoadAssetAsync<Texture3D>();
var op2 = Asset2.LoadAssetAsync<Texture3D>();
var op3 = Asset3.LoadAssetAsync<Texture3D>();
var op4 = Asset4.LoadAssetAsync<Texture3D>();
var frameTimes = new List<float>(1024);
while (!op1.IsDone || !op2.IsDone || !op3.IsDone || !op4.IsDone)
{
yield return null;
frameTimes.Add(Time.deltaTime);
}
PlayerRigs.UI.DisplayMessage($"TOTAL:{sw.Elapsed.TotalMilliseconds:F1}ms / FT:{frameTimes.Average():F1}ms", true);
_loading = false;
}```
that's the entire bit that was profiled
Can you convert that to a Task instead?
If you run task.run, it will run on another thread
if you run a coroutine, it will run async but not on another thread
But besides that, did you just take out parts to see, if the profiler hits something special. Like generating a 1024 list or so?
i'd speculate that won't fly, because completing a load with addressables triggers Application.IntegrateAssets, which is the bulk of the load, and cannot be offloaded onto a thread, being core unity logic - but i'll try, perhaps my gut feeling is wrong
i'm not entirely sure what you mean by that, can you elaborate?
make your coroutine an empty thing and then start adding one load, then two and so on, just to see, if any specific code gives you the biggest hickup
it scales pretty linearly from a single load to the 4 in the above snippet
hm, I would at least try the task.run() instead of the coroutine to see for any improvements of better thread handling
Asset1,2,3,4 are asset references, right?
correct
You could try to use Addressables.LoadAssetsAsync to get all at once instead of one by one at the same time?
it doesn't really matter
the huge spike is still there
and it's not even caused by addressables themselves
wait what? What does the profiler say, wher eit comes from?
scroll up a bit, i pasted the result
just under my first message
from what i've gathered it's unity copying the buffers from completed addressable jobs(?)
the load that addressables themselves do is near-instant
When are you loading those assets. on any scene switch or something?
with a scene already running, no major load
And you sure the garbage collection is not getting rid of something old from y previous scene?
there's no previous scene
Okay, dang 😄 getting out of ideas here
also GC is not spiking
i'm afraid it's just unity getting in the way of itself... again
I guess so too. But, please try the thread approach
when it comes to addressables, between just building the game normally and building the game w/ addressables, when using addressables the game size will always be larger right?
this has been my experience
makes sense due to it being unpacked
how did you call it?
we have some lightmap files that definitely do not make it into the normal build and are restricted to bundles, and they get way larger than before we had them separated
{
var sw = Stopwatch.StartNew();
var op1 = Asset.LoadAssetAsync<Texture3D>();
op1.WaitForCompletion();
var op2 = Asset2.LoadAssetAsync<Texture3D>();
op2.WaitForCompletion();
var op3 = Asset3.LoadAssetAsync<Texture3D>();
op3.WaitForCompletion();
var op4 = Asset4.LoadAssetAsync<Texture3D>();
op4.WaitForCompletion();
sw.Stop();
time = sw.Elapsed.TotalMilliseconds;
_loading = false;
return Task.CompletedTask;
}```
do you have a complete callback, you should use that to do mainthread stuff
but... the entire thing is mainthread stuff
i mean the addressable calls
they require to start from the main thread
unity can make a job/task out of them later, but the call itself has to stem from main thread
hm dang it
yeah, unity and threading just don't go hand in hand too well
thank god they at least made the job system
it's the, erm, thread our projects hangs on
let me try that thread async loading, that is weird
be my guest, i admittedly am not very well versed in task/async stuff
Yeah, so from forums and my test, its not working with background tasks. the loading is done in background but then gets integrated into the mainthread nonetheless
maybe just ease out the transition with loading first then fire the transition. anyways, yw 🙂
i can't - it's an open world game and i was hoping to load segments of the scene in or out depending on player proximity
I mean, you can load the assets at start, but not instantiate, you know?
not with 4 gigs of ram on board
4 gigs of ram, well, and not with a 4x86 cpu either, but whos gonna use it? 😄 what platform are you targeting?
quest 2
Well to be honest, open world for quest 2, you should know your limits then. You might just have to shrink down your resources, no matter how you load them. And if you only loading one chunk in and out at a time, not sure you really gonna see any blocking by then. But thats a lot about your assets you use and how often you gotta load things in and out
i know the dance
game's already on the store, but i was trying something new for a dlc
Oh okay, yeah you never know. What game is it if I may ask 🙂
thief sim vr for quest
Ha, this is looking fun!
probably way more fun to play than to develop 😛
Will tha twork on quest 1, guess not, right? 😄 Might have to hook it on my machine then
nah, it pushes Q2 to it's limits
if you're thinking of playing the steam vr version hooked up via cable, then it's not the same game
we've had to write our version from scratch to be able to fit it onto the quest
hence why i'm scrambling for new ways to handle large maps for new content
oh too bad, well, one day gotta get a new vr headset anyway, will wait for a new version then 😄
well, hopefully you find it fun 😁
Anyone know if it's possible to detect if a full rebuild is required instead of just a content build?
Anyone help with this error?
NullReferenceException: Object reference not set to an instance of an object
UnityEditor.AddressableAssets.Settings.AddressableAssetGroupSchemaSet.GetSchema (System.Type type) (at ./Library/PackageCache/com.unity.addressables@1.21.2/Editor/Settings/AddressableAssetGroupSchemaSet.cs:186)
When do you get this? In runtime or in editor?
What's the best Package for multiplayer in Unity?
like good for Multiplayer FPS games
There are several 3rd party ones or you can checkout netcode too.
Is there a way to create Addessable with one remote path, and then change that path by hand later ?
Or have something like a variable or %appdata% in the path that can be set at runtime?
I want to create addressables in one project and use in another and in first project I am not sure whjere I will be storing them in second, so I need to figure out a way to not hardcode path in first. I am good downloading everything by hand and loading manifest locally, but that manifest is looking for the bundle file in hardcoded address at addressable creation.
In theory it is fine on PC, since I can have relative path, but I need it to work on VR headset/android apk
maybe if you used the id of the addressable? as long as they have the same meta file that would technically work 🤔
(maybe, highly untested and unsure)
currently my plan is to have an external location (server/dropbox url, does not matter), have a text file with the names of all manifest files at the same location, then load manifest files directly so I can access all elements in the associated addressable. But I must rely on Unity caching method. I would prefer to have option to download everything locally and then store them, but .asset file location is hard-coded somewhere and only mention taht I found inside manifest json file is not fixing that 😦
Is there anyway to configure a scriptable object in such a way that whenever we create a new instance of it's type- it's automatically set as Addressable and applied a specific label
the BEST is photon fusion, hands down
some good alternatives are fishnet networking, and netick networking
I tried PUN 2
I'm getting mixed results looking up how to handle my terrain, I want to use addressables, not sure if scenes for each one are worth the effort?
perhaps someone here can assist, I'm trying to load an AssetBundle which is located under StreamingAssets folder on Android device but running into some issues.
anyone has experience with it? what's the correct way to do it?
Editor...
You can't build either without deleting the entire addressables folder and recreating it again...also it happens often...
What are you doing so far, and what are the issues? Loading an AssetBundle should be as simple as doing AssetBundle.LoadFromFileAsync, see https://docs.unity3d.com/ScriptReference/AssetBundle.LoadFromFileAsync.html
How do I achieve a loading order for addressables? if I have 2 asset packs that both contain, say, Models/foo.fbx, how do I make it so that pack 2's foo.fbx overwrites pack 1's foo.fbx?
Anyone knows if there's a way to check if a Directory.Exists using Application.streamingAssetsPath on Android?
There's BetterStreamingAssets plugin that helps with some utility methods, but it only has GetFiles and no HasDirectory
Did you try to use that code you ask for?
If google is right, you have to use a webrequest on your android device: https://stackoverflow.com/questions/35582074/access-unity-streamingassets-on-android
is there any way that I can modify the remote catalog path after the game already was built?
I'm hosting my bundles in a FTP directory and trying to access it as i did with assetbundles, but it's giving me some errors, mainly "Invalid port specified." anyone know if there is a specific setting that i must pay attention. Btw, I'm able to get download size, but not downloaddependency, neither load the bundle
Hey Guys! I am having trouble getting Addressables to work properly and is receiving a lot of errors
2023/02/10 23:09:21.471 27173 29689 Error Unity RemoteProviderException : Unable to load asset bundle from : http://localhost/Android/defaultlocalgroup_assets_all_20331e222bbf3523b41fee06f2e73db7.bundle
2023/02/10 23:09:21.471 27173 29689 Error Unity UnityWebRequest result : ConnectionError : Cannot connect to destination host
2023/02/10 23:09:21.471 27173 29689 Error Unity url : http://localhost/Android/defaultlocalgroup_assets_all_20331e222bbf3523b41fee06f2e73db7.bundle
2023/02/10 23:09:21.471 27173 29689 Error Unity
2023/02/10 23:09:21.474 27173 29689 Error Unity RemoteProviderException : Unable to load asset bundle from : http://localhost/Android/defaultlocalgroup_unitybuiltinshaders_9c7fe3fee2858f3c569efe25a339af81.bundle
2023/02/10 23:09:21.474 27173 29689 Error Unity UnityWebRequest result : ConnectionError : Cannot connect to destination host
2023/02/10 23:09:21.474 27173 29689 Error Unity url : http://localhost/Android/defaultlocalgroup_unitybuiltinshaders_9c7fe3fee2858f3c569efe25a339af81.bundle
2023/02/10 23:09:21.474 27173 29689 Error Unity
2023/02/10 23:09:21.477 27173 29689 Error Unity OperationException : GroupOperation failed because one of its dependencies failed
2023/02/10 23:09:21.477 27173 29689 Error Unity RemoteProviderException : Unable to load asset bundle from : http://localhost/Android/defaultlocalgroup_assets_all_20331e222bbf3523b41fee06f2e73db7.bundle
Can anyone help me out with this issue?
I have set everything to remote load path and remote build path but still it seems to load from some localhost and I have also changed the url's to the remote load path
figured it, looks like i can just specify a runtime path (but will have to figure out how to load the path itself from an addressable possibly)
Question: I am new to using addressable but now I leaned how to use it and also how to use remote addressable but my question is, do remote addressable load the assets from the cloud to the build files or does it exist in the build file already, what I mean is:
for example, my game size after build is 110MB, so the player has to download 110MB but I actually want the player to download only 100MB and start the game and then click a button in the game to download the other 10MB later, so I have a files named "Extra10MB" that is a 10MB of size and I used remote addressable to keep it in the cloud, now when I build project, will it be a 100MB and after loading the "Extra10MB" file it will be 110MB ? or will it be a 110MB always anyway
my build broke for no particular reason. it's telling me this, but i cant make sense of it. Looking online did lead me to discovering this, but it doesnt really help me, since I don't have an asset (that I know of) called TestMob.
The project will be 100MB and the other 10MB file will be downloaded the first time you try to use it
It won't be saved in the build though, but in a cache in Application.persistentDataPath
If I have a unity scene with scripts attached, how can I loaded as addressable and additively add it to a new scene and keep the scripts from the first scene? Thank you
Using this with LoadSceneMode.Additive https://docs.unity3d.com/Packages/com.unity.addressables@1.15/manual/LoadSceneAsync.html
We have a content delivery system based on uuids and I'd like to patch that into addressables
so what I have working is creating a big catalog from json (containing valid bundle urls) into a ResourceLocationMap
but what I'd rather have is small resource locations that are resolved during requests
i.e. somehow implementing my own IResourceLocation that is only the uuid, then implementing the right interface that will resolve that uuid into the bundle https url on request
since the lookup from uuid to https url could take time I want it to be async, but IResourceLocator.Locate is synchronous
so maybe I could push it further down to the point just before it would issue the web request?
wondering, but is there a addressable asset group profile that I can use? I want certain builds to fetch assets from local/remote depending on which, but from what I see there isnt a way to do it
so for example, on android builds I want to build content locally instead
or is it something I should just do through an editor build script?
Having issues when loading sprites, but other things such as prefabs, audioclips, etc all seem to be working fine. Any hints?
Anyone knows why scene asset dependencies are not showing up in event viewer?
only scene is labeled as addressable
but assets that are part of that scene are not shown
That is because when you build assets they are all added to your addressables automatically as part of the scene asset. They are not showed separately. So you can imagine it as beeing one big package. To see every single asset loaded you need to add all of them into addressables. You can simply add whole folders and everything that is inside folder will be loaded as one package. So in short, you either need to make it into mode smaller pieces, as when you load scene, you load it as one package (unless it have multiple packages that it shares)
are you not searching for addressables profiles? As depending on profile you can setup are addressables are local or not. Offcourse you will need to change profile on build either via code depending on platform or yourself manually
profiles dont let you configure whether an addressable group is remote or not, it only lets you configure the local/remote build/load path that you pre-set on each addressable group
Awesome, thank you!
I also might be on an older version but, I can't pause the graph at any point, it just keeps going
do you know if there is a workaround ?
And also is event manager exstendable ?
I think only wayto pause graph is to pause game it self in editor.
yea, but you can set remote to be the same as local. So even if in options it is remote it will still load from local. Isnt it?
Thats true
I guess I should treat local/remote as just 2 different options rather than it being strictly load from local/remote?
I am using unty 2021.3.15f1 to build android games. When I run addressable build script on Jenkins machine, I got bugs then got Addressable content build failure but I still can open editor and build manually. Anyone know about this? I just got this issue 2 days lately.
This is only one method, you can always create script that runs on build to change options depending on build platform. This would give you more freedom to control stuff. Also you could try follow similar managment as when you do Locale addressables.
oh yeah thats still the plan, ive got a script to change between profiles on certain builds already
Yeah but I am trying this on a local build.
Sorry I am not aware of possibility like that then.
Ok
no worries, thank you for your help.
do you know if there is a doc somewhere explaining different strategies for the content organization?
Also in a case of a scene that is marked as addressable - it will automatically load all the scene assets into a bundle.
What would happen if I mark any of the individual scene assets as addressable?
It will automatically pull ALL assets that are in scene into same bundle. But That is not always what you want. For example there are two Scenes: A and B. You have Table and door in scene A, and Table and Windows in scene B. If you will mark both Scenes as addressables it will create two packages, both including Table in it. So in general you will duplicate your Table data. How ever if you will mark Table asset as addressable and both scenes as addresable, both scenes will be able to include addressable asset of the table, so you wont be duplicating your assets.
So it very depends on your project, sometimes you want assets to be duplicated (kinda cloned), but sometimes you want to use same stuff to save size or memory. Normaly I would suggest to plan your assets well, decide which assets in what packages should be, then put them in pretty way and enjoy performance. Or you can run addressables analizer, which will find all duplicates assets for you, and will create duplicates package, which does the same thing. But it not always what you need, and I strongy suggest use addressables analyze tool as checking data and assets rather than fixing things instead of you.
Hi, I have this issue when trying to build addressable by command line (Jenkins)
Anyone know how to fix it?
I still can build addressable without any issue manually through editor.
are you running the unity executable from the commandline?
yes, I am running a static function from commandline
and unity is installed on the build machine?
yes
I am running an jenkins agent on my computer. I still can build addressable manually myself but when call it though jenkins (command line), I have this bug.
Has anyone solved or mitigated having fonts pulled into bundles from them being referenced in UI? I like creating UI and seeing it in the scene view, but don't necessarily want the fonts used to be duplicated in each scene bundle just because it's being used for each scene
Usually if you have shared assets that are being included in multiple bundles, you can run the Check Duplicate Bundle Dependencies Analyze Rule in the Addressables Analyze window. Have you done that, or does that not work for your use case?
I think the problem is that the font being directly referenced from a TMP Text component doesn't know to load the font via Addressables so it doesn't even matter if the font is inside a bundle in the first place?
It could be. It doesn't hurt to run the rule/fix it and see if it creates a new group with the font in it. Or have you tried that already?
I believe I have, I'll check again
You could also try creating a new group and placing the font there manually (if possible). If that doesn't work then I would guess there's some kind of issue with the Addressable Dependecy detection code. Try filing a bug report. I'm just spit balling here, I haven't worked with the TMP Text component . . .
A separate Question:
The documentation implies you can partially load Assets from an Asset Bundle (i.e., load one Asset without loading the other Assets in the Bundle into memory), but then in other parts of the docs it says when you load an Asset, the entire Asset Bundle is loaded into memory. So which is it? If it's the former (partial loading), how does this work? Is the entire Asset Bundle downloaded to the device but only the Asset that is needed is loaded into the game memory?
It looks like I was right and the fonts (even though they exist in a bundle) are being duplicated in the Scene in which the font is being used. Scene to Addressable Duplicate Dependencies . hmmmm
Hey all, does anyone know how exactly the asset cache in memory works? I have started studying the code, the cache in memory is just a dictionary so far so good, but I have some questions
https://forum.unity.com/threads/addressables-and-cache.1401220/ probably better to ask on the forum
Hi everybody, I've got a small question regarding how I should store instances of my addressables, in particular sounds. Without addressable, if we want to animate a menu with hover and click sounds, we'd have 1 audio source for the click and 1 audio source for the hover sounds. When using addressable, should we try to replicate this behavior by creating as many audio sources as we have sounds or should we reload the addressable repeatedly when required?
Does keeping the loaded addressable in an audio clip take a lot of memory space? I'd assume since the default way already stores an instance of the clip, creating as many audio sources as needed after addressables are loaded would be the logic way to go? Plus having only one audio source for sound would prevent playing multiple sounds at the same time. Just wondering how others handle such case?
How do i update addressable without breaking the project?
I'm not sure I understand your problem 100%, but ideally - keep all the audio assets loaded as long as you might possibly need them without loading and unloading because it's more trouble than it's worth, unless you have hundreds of those
as for actually playing them, check out AudioSource.PlayOneShot, might be what you're looking for
also, it takes exactly the same amount of memory if you have the one audio clip assigned to zero or one hundred audio sources - as long as its loaded, and the amount of audio sources doesn't change
I have an issue where i want to go back to the sprite edit and slice using the mouse but every time i do that and let go the sprite editor selects the latest slice and no new slice been added, any ideas ?
- I completely do not understand what is going on
- this is not the right channel to ask this, try #🖼️┃2d-tools maybe, #💻┃unity-talk perhaps
Ok thanks
I had the same question. Is it loading a single asset or the whole group.
Hi guys, I try Addressable on Webgl and build remote to reduce size. I'm using bucket on Google cloud Storage. But when I run, it got CORS error. Could someone show me how to fix this?
Can addressables be used to load all assets implementing a given interface?
Trying to plan my game around what Addressables are capable of
...Basically I wanna be able to, at runtime, load all assets of a given type - without knowing where or how many of those assets there are
Some assets could come in from Steam Workshop, for example
how are you planning to build asset bundles if they're going to be somewhat arbitrary 🤔
What do you mean? @hoary rampart
I'm just completely new to the system
Never used it before
So trying to figure out what I'm able to do
...that being said, my game's a clean slate...there's no asset management system in it whatsoever rn, so I don't need to deal with porting anything
before you can use addressables you need to build them into content bundles first https://docs.unity3d.com/Packages/com.unity.addressables@1.20/manual/Builds.html
if you plan on just grabbing things from arbitrary online locations you'd probably want to use regular webrequests
Nonono I'm not dealing with online data
...when I mentioned Steam Workshop earlier, I meant that I'd let Steam download a workshop asset's data locally...and when that's finished (Steam notifies the game when that's done), the game would do whatever magic is necessary to bring that workshop item's content into the game at runtime
im not actually sure you can build assetbundles at runtime either
...That's only if the workshop item is actually built using the addressables system to begin with. Some items might not be, but that was just an example
you need to be able to run an editor instance
Annnnnd that's where https://github.com/alkalinethunder/SociallyDistant comes in
If you want to build a mod, you clone that, install Unity, and now you have a barebones version of the game + a Unity Editor to use to build the mod with
So THAT problem is solved
HOWEVER, that also means the game's Career Mode is also a mod
...and so is the core, technically
So let's assume I already have a bunch of addressable assets and it's all set up properly
....how do I load all assets of a given type
I don't know how many assets there are, nor do I know WHERE they are, but all of my content packs are fully downloaded and ready to go. I just want to load all assets in all content packs where each asset is of a given type.
ohhhkay but, is there not a way to get all keys that point to an asset of a given type
I'm trying to avoid as much manual work as possible
could anyone help me with a problem in animating my character, the animation doesn't stop immediately when I let go of the input button, and also when I hold the input button the animation doesnt fully loop, but skips frames and then loops.
Addressable isn't the area to ask this question.
But you probably have "Has Exit Time" enabled in the transition, which forces the current animation to finish before transitioning
oh my bad and thanks
Is it possible to remove addressables with BuildPipeline.BuildPlayer?
(for dedicated servrr)
Does anyone have this weird issue after upgrading addressables from 1.21.2 -> 1.21.8? (error shows after analyze selected rules)
EDIT: Found the issue, my scripting backend was set to IL2CPP but IL2CPP module for windows was not added and this lead to this unclear error.
@leaden flax Do no crosspost. This question has nothing to do with addressables.
know somebody, why if an asset has in name # symbol addressables load doesn't work ? One day I am looking for why I can't load asset, because of naming.
having unexpected special characters in names will generally break stuff in software
Since upgrading to 2022.2.6, some of our machines have issues using AssetReferences, when using the picker it works fine the first time, but trying to re-set it does a null ref
UnityEditor.ProjectBrowser.FrameObject (System.Int32 instanceID, System.Boolean ping) (at <1ef2856add15407ab99fef0e978737e3>:0)
UnityEditor.EditorGUIUtility.PingObject (System.Int32 targetInstanceID) (at <1ef2856add15407ab99fef0e978737e3>:0)
UnityEditor.EditorGUIUtility.PingObject (UnityEngine.Object obj) (at <1ef2856add15407ab99fef0e978737e3>:0)
UnityEditor.AddressableAssets.GUI.AssetReferenceDrawer.DrawControl (UnityEditor.SerializedProperty property, System.String nameToUse, System.Boolean isNotAddressable, System.String guid, System.Boolean isEnterKeyPressed) (at ./Library/PackageCache/com.unity.addressables@1.21.3/Editor/GUI/AssetReferenceDrawer.cs:216)```
Anyone else experiencing this?
Has someone have resources to learn deeper about Addresables besides unity documents and unity learn>?
