Skip to content

Fix adding outline when SceneSpawner is not in the world#74

Merged
komadori merged 1 commit into
komadori:masterfrom
simgine:fix-scene-spawner
May 11, 2026
Merged

Fix adding outline when SceneSpawner is not in the world#74
komadori merged 1 commit into
komadori:masterfrom
simgine:fix-scene-spawner

Conversation

@Shatur
Copy link
Copy Markdown
Contributor

@Shatur Shatur commented Apr 22, 2026

Bevy removes it from the world when a scene is spawned via SceneSpawner:
https://github.com/bevyengine/bevy/blob/f667c282dad2c1419afb5836ded22a3ec263970e/crates/bevy_scene/src/scene_spawner.rs#L560

If AsyncSceneInheritOutline is inserted during the scene spawning (via a required component or via trigger), the system won't run since it requires SceneSpawner.

Tests use DynamicSceneRoot instead of using SceneSpawner directly and it works since it uses a bit different mechanism.

I noticed this in my game and tested the fix.

Looks like the crate still uses Rust 2021, so I can't use chained if let. I tried updating, but this requires a bunch of other changes in formatting and triggers a few clippy warnings, so I kept the version as is.

Bevy removes it from the world when a scene is spawned via
`SceneSpawner`:
https://github.com/bevyengine/bevy/blob/f667c282dad2c1419afb5836ded22a3ec263970e/crates/bevy_scene/src/scene_spawner.rs#L560

If `AsyncSceneInheritOutline` is inserted during the scene
spawning (via a required component or via trigger), the
system won't run since it requires `SceneSpawner`.

Tests use `DynamicSceneRoot` instead of using `SceneSpawner`
directly and it works since it uses a bit different mechanism.

I noticed this in my game and tested the fix.
@Shatur Shatur force-pushed the fix-scene-spawner branch from c85d37d to 132fb4d Compare April 22, 2026 22:51
@komadori komadori merged commit a20da4c into komadori:master May 11, 2026
4 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants