Skip to content
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

Only despawn scene entities still in the hierarchy #17938

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

cart
Copy link
Member

@cart cart commented Feb 19, 2025

Fixes #17883

Objective + Solution

When doing normal scene root entity despawns (which are notably now recursive), do not despawn instanced entities that are no longer in the hierarchy.

(I would not classify this as a bug, but rather a behavior change)

Migration Guide

If you previously relied on scene entities no longer in the hierarchy being despawned when the scene root is despawned , use SceneSpawner::despawn_instance() instead.

@cart cart added the A-Scenes Serialized ECS data stored on the disk label Feb 19, 2025
@cart cart added this to the 0.16 milestone Feb 19, 2025
@TimJentzsch TimJentzsch added D-Straightforward Simple bug fixes and API improvements, docs, test and examples S-Needs-Review Needs reviewer attention (from anyone!) to move forward labels Feb 19, 2025
@alice-i-cecile alice-i-cecile added S-Ready-For-Final-Review This PR has been approved by the community. It's ready for a maintainer to consider merging it and removed S-Needs-Review Needs reviewer attention (from anyone!) to move forward labels Feb 20, 2025
Copy link
Contributor

@rparrett rparrett left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Cool. The previous default behavior is logical but this definitely seems like what people will want/expect most of the time.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-Scenes Serialized ECS data stored on the disk D-Straightforward Simple bug fixes and API improvements, docs, test and examples S-Ready-For-Final-Review This PR has been approved by the community. It's ready for a maintainer to consider merging it
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Calling despawn_recursive() despawns entities that are no longer descendants
6 participants