Asset loading not behaving the same when using AssetMode::Processed
- Dominant language
- Rust
- Stars
- 48.2k
- Forks
- 4.8k
- Avg merge
- 3d 16h
- Merged PRs (30d)
- 171
Description
## Bevy version and features
bevy 0.16.1 with the cargo feature `asset_processor`
## What you did
I used `AssetMode::Processed` mode with relative paths.
```rust
use bevy::prelude::*;
fn main() {
let mut app = App::new();
app.add_plugins(
DefaultPlugins
.set(AssetPlugin {
mode: AssetMode::Processed,
..Default::default()
})
.set(ImagePlugin::default_nearest()),
);
app.add_systems(Startup, fails);
app.run();
}
fn fails(mut commands: Commands, asset_server: Res) {
commands.spawn(Camera2d);
let face: Handle = asset_server.load("sprites/../sprites/face.png");
commands.spawn(Sprite::from_image(face));
}
```
## What went wrong
The relative path `sprites/../sprites/face.png` cannot be found, but only when using `AssetMode::Processed`.
`ERROR bevy_asset::server: Path not found: sprites/../sprites/face.png`
Contributor guide
Assessment
This issue has not been assessed yet.