It appears to me that there is only one “Async Load Asset” instance. If it loads something but doesn’t finish loading, and you tell it to load something else, it will stop loading the previous object and try to load the new one.
I have a custom For Each Loop where I can specify a delay and using this method works. Because I’m waiting half a second to give the next command and Async Load Asset manages to finish the previous task. Obviously this can’t work in the real world because you don’t know how fast the player computer is and how much time it takes to load a resource.
It appears I’m missing something here. There is a need to load multiple assets at runtime, right? So how can I load them?
this is interesting and may work for me, I will see if I can implement it properly. Thank You.
Checking a bunch of info on this stuff, it appears that if you use this async Load function in code in C++, it lets you define a function that you can use to take care of the loaded object. A delegate or something, whatever that is
I didn’t try the above because I’m need to first learn how to use C++ in unreal and how all this works. I don’t have a week to learn all this code stuff just to see if it works.
So maybe the function loads the object but it doesn’t give it back properly in a loop in blueprint. You practically don’t know where it is in memory
A second solution may be that pesky Asset manager, which appears to let you define some rules to load a bunch of assets at the time, but oh my god is incredible the lack of clear tutorials for people like me on this topic.
You need to make sure you exit the loop at some point. This is why in the example I provided, I fill an array before starting the loop, then in each execution I grab the first element and remove it from the array.
If you wanna switch to c++, look into FStreamableManager → RequestAsyncLoad, which is much more convenient as it can effectively load batches. You simply give it an array of SoftObjectPtr/SoftObjectPath.
I will try to understand how the Asset manager works. I think I need to define some rules then I can use it to automatically load the assets. Its a bit arcane how it works for now. The official documentation is written like you already know what they are talking about which doesn’t help
Hey, I know this is quite an old post, but I came into the same situation while trying to spawn items on objects’ destruction using Async Load, and I have a solution that might work for someone who could be looking into this later.
My solution was to create a macro library function that has a gate to continue the loop. I created both a for each loop and a for loop in my case. See the pictures:
See the pictures :
They’re basically the same for each and for loops, but instead of letting the sequence assign the next index, we pass it through the exec gate input, which would come after the async load has finished.
You can even nest the for loop with the gate into the for each loop with the gate by passing the complete from the for loop into the for each exec input gate.
I don’t know if this applies to your project but I’ve made all this asset async load thing to work using the Asset Manager. It has blueprints nodes that have outputs with (when loaded), so you can call an event or something when the asset is loaded, to know when you can use it safely. It also has functions to load multiple assets as a bundle.
I don’t remember precisely the details, it passed two years , I don’t have the project on hand, if you don’t manage to make it work ask me here maybe i can help. This worked for the blueprints workflow even if the tutorials online are mostly for C++ scripting