-
-
Notifications
You must be signed in to change notification settings - Fork 4.4k
Open
Labels
C-BugAn unexpected or incorrect behaviorAn unexpected or incorrect behaviorS-Needs-TriageThis issue needs to be labelledThis issue needs to be labelled
Description
Bevy version and features
bevy = { version = "0.18.0", features = ["debug"] }
What you did
#[derive(Bundle)] is not behaving as I would expect with a bundle struct defined as:
#[derive(Bundle)]
#[bundle(ignore_from_components)]
pub struct PipeBundle {
pub pipe: Pipe,
pub name: Name,
pub visibility: Visibility,
pub transform: Transform,
pub children: SpawnRelatedBundle<
ChildOf,
(
Spawn<PipeTopBundle>,
Spawn<PipeGateBundle>,
Spawn<PipeBottomBundle>,
),
>,
}
impl PipeBundle {
pub fn new(asset_server: Res<AssetServer>, position: f32) -> Self {
Self {
...
children: children![
PipeTopBundle { ... },
PipeGateBundle { ... },
PipeBottomBundle { ... },
],
}
}
}What went wrong
If used in commands.spawn(PipeBundle::new(asset_server, gap_y_position)); it will produce a Entity that has it's own components and a empty children list
I can confirm that if instead of using the struct I use a common tuple with the exact same contents then the Entity spawns correctly with all its children.
Additional information
Doing some looking into the definition of the derive macro I noticed that unsafe fn apply_effect( ... ) {}, which I believe is responsible for spawning the children, has a empty function body.
Metadata
Metadata
Assignees
Labels
C-BugAn unexpected or incorrect behaviorAn unexpected or incorrect behaviorS-Needs-TriageThis issue needs to be labelledThis issue needs to be labelled