What's the best way to clean/despawn everything? #218
-
If the player wants to return to the main menu, for instance. Right now I can query for LevelSet and call despawn_recursive, but once the player starts a new game and a new LdtkWorldBundle is spawned, textures start to break and I get other strange behavior. So I think I must not be getting everything? |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 1 reply
-
This sounds like a bug that's in [patch.crates-io]
bevy_ecs_tilemap = { git = "http://github.com/StarArawn/bevy_ecs_tilemap", version = "0.11", branch = "main" } As for the best way to despawn everything, it depends on whether or not you want to keep the |
Beta Was this translation helpful? Give feedback.
This sounds like a bug that's in
bevy_ecs_tilemap
0.11. You may have better luck here with this patch:As for the best way to despawn everything, it depends on whether or not you want to keep the
LdtkWorldBundle
you've already spawned around. If you don't then what you're doing is probably fine. If you want to keep it around (in case you're not storing theHandle<LdtkAsset>
anywhere else), it may suffice to empty theLevelSet
collection instead, but it might get automatically re-populated if you have aL…