Closed rayanmargham closed 1 year ago
Please respond ASAP, I need this plugin for a project
asset_server.load("bf.png");
doesn't immediately load the image, instead it queues all assets to load later in the background. At the point that you call .bundle(&mut sprite_params));
bevy_sprite3d needs the image to be loaded in order to construct the mesh.
To fix this either add a loading stage as shown in examples/sprite.rs or use bevy asset loader as shown in examples/bevy_asset_loader/sprite.rs (this example isn't yet updated to 0.10, though the changes are pretty minor).
More info: https://github.com/FraserLee/bevy_sprite3d/blob/main/readme.md?plain=1#L92-L98 https://docs.rs/bevy/latest/bevy/asset/struct.AssetServer.html#method.load https://bevy-cheatbook.github.io/assets/assetserver.html
I'm cramming for finals rn, will look into adding a more informative error message when I get a sec. Ask away and re-open this issue if you need any help though I might not respond for a while. Good luck!
What's the Error? when attempting to spawn a sprite3d and upon calling bundle this line of code panics:
let image_size = params.images.get(&self.image).unwrap().texture_descriptor.size;
however bevy is able to load the image just fine. here's my full code.