You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Currently, this results in Children containing "dead" entities after the first time a snapshot restore happens.
To Reproduce
Steps to reproduce the behavior:
spawn an entity with .add_rollback(), and a child without .add_rollback()
trigger a rollback
traverse Children hierarchy, it now points to a "dead" entity
Expected behavior
I would expect the entity ids of the children without Rollback components to be left alone (like they used to).
Describe alternatives you've considered
Adding "cosmetic follower entities" in a separate hierarchy branch that contain a reference to the rolled back entity, and have a book-keeping step where entities with dangling refs are despawned, and positions are synced.
I'm not sure if it's possible in your context, but can you add identity mappings for the entities in question to the map? That way, they'll be preserved during entity mapping instead of being replaced by dead entities.
Describe the bug
I'd like it to be possible to spawn cosmetic entities as children of rolled back entities.
Used to work prior to #31
For instance to:
Currently, this results in
Children
containing "dead" entities after the first time a snapshot restore happens.To Reproduce
Steps to reproduce the behavior:
.add_rollback()
, and a child without.add_rollback()
Children
hierarchy, it now points to a "dead" entityExpected behavior
I would expect the entity ids of the children without
Rollback
components to be left alone (like they used to).Describe alternatives you've considered
Adding "cosmetic follower entities" in a separate hierarchy branch that contain a reference to the rolled back entity, and have a book-keeping step where entities with dangling refs are despawned, and positions are synced.
Additional context
The problem is that
map_entities
for unknown entities returns "dead" entities: https://github.com/bevyengine/bevy/blob/8ace2ff9e361dd7ef1bc620b84674def0cb56454/crates/bevy_hierarchy/src/components/children.rs#L26bevyengine/bevy#6790
The text was updated successfully, but these errors were encountered: