#name in a bsn_list! scene-component prop resolves to the same entity as the outer scene's #name

Open
#26,446 1 comment 0 reactions 0 assignees View on GitHub

Maintainers usually reply within 2 days

Nobody has claimed this yet.

Assessment

Difficulty
4/5
Estimated time
3-5 days
Newbie friendliness
53/100
Issue type
Bug
Clarity
Mostly clear
Activity status
Active
Tech stack
rust
Domain
game-dev

Research direction

Start by reproducing the nested bsn_list! case from the issue’s attached example, then trace how scene component props and #name entities are handled during spawning. Check nearby scene spawning tests and add coverage for both the outer root and nested list names. Done when both named entities spawn with the expected parent relationship.

Written by the indexing model from the issue text.

Description

A-Scenes C-Bug D-Macros D-Modest S-Ready-For-Implementation

Bevy version and features

0.20-dev

What you did

Spawned a scene component whose prop is a Box<dyn SceneList>, which its scene function places as children, with a #name on both the outer root and the nested list:

world.spawn_scene(bsn! {
    @Wrapper {
        @contents: bsn_list! { #Inner },
    }
    #Outer
});

What went wrong

Only one named entity spawns, named Inner, with no parent; Outer is gone. The two #names resolved to the same entity.

Additional information

Minimal repro example attached:

bsn_nested_names.rs.zip

(Note: example was LLM-generated.)

@cart

Dominant language
Rust
Stars
49.8k
Forks
5.1k
Avg merge
3d 4h
Merged PRs (30d)
136

Getting set up

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from bevyengine/bevy

All issues in bevyengine/bevy

Similar issues

More Rust issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.