Skip to content

Try despawning the related Observer from ObservedBy.#24813

Open
andriyDev wants to merge 1 commit into
bevyengine:mainfrom
andriyDev:no-warn-linked-observer
Open

Try despawning the related Observer from ObservedBy.#24813
andriyDev wants to merge 1 commit into
bevyengine:mainfrom
andriyDev:no-warn-linked-observer

Conversation

@andriyDev

@andriyDev andriyDev commented Jun 30, 2026

Copy link
Copy Markdown
Contributor

Objective

Solution

  • Switch despawn to try_despawn.
    • It looks like this happens if the relationship despawns the observer, and then the ObservedBy tries to despawn the observer.

Testing

@andriyDev andriyDev added C-Bug An unexpected or incorrect behavior D-Trivial Nice and easy! A great choice to get started with Bevy A-ECS Entities, components, systems, and events S-Needs-Review Needs reviewer attention (from anyone!) to move forward labels Jun 30, 2026
@github-project-automation github-project-automation Bot moved this to Needs SME Triage in ECS Jun 30, 2026
@andriyDev andriyDev added this to the 0.19.1 milestone Jun 30, 2026

@mgi388 mgi388 left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Approving on the basis that I’ve had this patch in my Bevy 0.18 fork for ages: mgi388@f2ebb13

I’ve tried to wrap my head around the deferred nature of Bevy in cases like this. And I’ve just come to the conclusion that most things like this are deferred, as in something else could have removed the entity by the time the despawn here actually runs so I feel like all of these need to be try_. Not an ECS dev though.

@andriyDev andriyDev 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 Jun 30, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

A-ECS Entities, components, systems, and events C-Bug An unexpected or incorrect behavior D-Trivial Nice and easy! A great choice to get started with Bevy S-Ready-For-Final-Review This PR has been approved by the community. It's ready for a maintainer to consider merging it

Projects

Status: Needs SME Triage

Development

Successfully merging this pull request may close these issues.

Despawning observers through its target after despawning through another Relationship logs a warning!

2 participants