You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I have a chat room, and when a message comes in, there could be emojis that need to be downloaded for display. Those emojis need to be fully downloaded so that I can properly scale them!
All I'm trying to do is assert that the asset needs to be fully loaded before we can spawn it in.
The result?
I cannot explain this.
It re-downloads every update, instead of waiting for the existing handle to finish loading.
Furthermore, it appears that the handle stays to be index 0 generation 0 until it finishes downloading, then it just gives me a new generation handle every update and refuses to give me the downloaded asset!
Can anyone explain this?
I saw @mockersf had a very similar discussion a while back, although it makes no sense 3 years later: #1863
The text was updated successfully, but these errors were encountered:
I believe the issue here is you're dropping the Handle on each frame;
fnget_handle(asset_server:Res<AssetServer>,fonts:Res<Assets<VelloFont>>){// Handle created and loading startedlet handle = asset_server.load::<VelloFont>("...");letSome(font) = fonts.get(&handle)else{// Highly likely the asset hasn't loaded immediately (latency, etc.)// Because of that, this function always returns
warn!("asset does not exist");return;// Now that we've returned, the Handle is dropped, which causes the load to be cancelled};// ...}
Instead, try storing the Handle in a resource (or an Entity as a Component). That way the Handle will survive long enough for the load to complete.
Bevy version
0.13
The issue
I have a chat room, and when a message comes in, there could be emojis that need to be downloaded for display. Those emojis need to be fully downloaded so that I can properly scale them!
Here's my system that spawns the chats:
All I'm trying to do is assert that the asset needs to be fully loaded before we can spawn it in.
The result?
I cannot explain this.
It re-downloads every update, instead of waiting for the existing handle to finish loading.
Furthermore, it appears that the handle stays to be index 0 generation 0 until it finishes downloading, then it just gives me a new generation handle every update and refuses to give me the downloaded asset!
Can anyone explain this?
I saw @mockersf had a very similar discussion a while back, although it makes no sense 3 years later: #1863
The text was updated successfully, but these errors were encountered: