Repository navigation
Bevy version0.15 ProblemHow am I supposed to load a e.g. I have a string, such as: Solution(This doesn't work because DynamicScene doesn't implement struct LoadScene {
scene: String,
}
impl Command for LoadScene {
fn apply(self, world: &mut World) {
let asset_server = world.resource::<AssetServer>();
let scene: DynamicScene = ron::from_str(&self.scene).unwrap();
let handle = asset_server.add(scene);
let root = DynamicSceneRoot(handle);
world.spawn(root);
}
} |
Answered by
MrGVSV
Apr 6, 2025
Replies: 1 comment
|
You have to deserialize the scene with its dedicated deserializer: Or you can load it from a file like in this example. |
0 replies
Answer selected by
nuzzles
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
You have to deserialize the scene with its dedicated deserializer:
SceneDeserializer.Or you can load it from a file like in this example.