#Awaiting asset loading within startup system

5 messages · Page 1 of 1 (latest)

foggy pecan
#

Is there a lighter way of loading a custom asset? We are using the bevy_pathmesh and had a very bad time getting asset loading to work.

We thought we could do everything in a startup system. Looking at the example from that crate, he used a startup system to load the asset with asset_server.load() and then had a second system running, checking if it was loaded and then did the spawning logic.

This approach of having a custom system checking each cycle if the asset is loaded, even after it has been loaded, seems weird to me. Now, looking at the official bevy examples (https://github.com/bevyengine/bevy/blob/latest/examples/asset/custom_asset.rs), I can see this seems to be the default / recommended way.

Is there no other option of awaiting asset loading within a startup system?

tiny silo
#

I've been using states to load custom assets, so I'll have a starting state that loads on enter, checks until the asset is loaded, then exits / transitions to a state that can assume the asset's loaded. This is a good starting place for states I think

foggy pecan
#

oh wow, system set is new to me but looks veeery promising! I will give that a try later and refactor it. I'll let you know if that did the trick for my project. gonna be afw for a while until then. but thanks already for this proposal!

forest spear