-
Notifications
You must be signed in to change notification settings - Fork 69
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
LDTK entity problem. #303
Comments
Sorry it took me some time to get to this issue.
So, once an entity is spawned via the registration system, it will be a grand-child of the level entity in bevy's transform hierarchy. You can read more about the hierarchy of the LDtk world the plugin follows in this chapter: https://trouv.github.io/bevy_ecs_ldtk/v0.9.0/explanation/anatomy-of-the-world.html So, actually, when a level despawns (recursively), it should despawn all of its children, which includes all of its entities. Is that not what you're observing? How are you despawning levels, are you using the level selection mechanisms provided by the plugin? The exception to this is entities that you give the
This is not entirely correct. It is true that all entities within a level are spawned at once. However, it's not necessarily the case that all levels are spawned at once - only the newly-selected ones in the previous update. Also, entities are spawned only once when the level is spawned, but if that level is despawned/respawned then those entities will be despawned/respawned too. The exception to this, again, is entities given the I hope this clears things up, but I'm not 100% sure I understood your questions completely. |
Perhaps I don’t understand something, but I have such strange seemingly problems:
I have no way of knowing to which level the entities “registered in LDTK” belong. And I really need this in order to somehow delete them when changing levels or exiting. I can enter a level once and delete it, but when I enter it a second time, it turns out I have to load the entire ldtk world, and at the same time somehow save what level we are moving to... It looks extremely strange.
Is it really true that all entities of all levels are created at once and only 1 time?
The text was updated successfully, but these errors were encountered: