-
-
Notifications
You must be signed in to change notification settings - Fork 4.2k
Closed
Labels
A-ECSEntities, components, systems, and eventsEntities, components, systems, and eventsC-BugAn unexpected or incorrect behaviorAn unexpected or incorrect behaviorD-StraightforwardSimple bug fixes and API improvements, docs, test and examplesSimple bug fixes and API improvements, docs, test and examplesP-RegressionFunctionality that used to work but no longer does. Add a test for this!Functionality that used to work but no longer does. Add a test for this!S-Ready-For-ImplementationThis issue is ready for an implementation PR. Go for it!This issue is ready for an implementation PR. Go for it!
Milestone
Description
Bevy version
0.16.0
What you did
repro:
use bevy::prelude::*;
fn main() {
App::new()
.add_plugins(MinimalPlugins)
.add_systems(
Startup,
(
|world: &mut World| {
let child = |i: usize| {
world.spawn(Name::new(i.to_string())).id()
};
let children = (0..3).map(child).collect::<Vec<_>>();
let mut parent = world.spawn_empty();
parent.insert_children(0, &children);
// for child in children {
// parent.add_child(child);
// }
let children = parent.get::<Children>().unwrap().into_iter().copied().collect::<Vec<_>>();
for child in children {
println!("{:?}", world.entity(child).get::<Name>().unwrap());
}
},
),
)
.run();
}
outputs
"1"
"2"
"0"
but should output this
"0"
"1"
"2"
which it does when using the commented out .add_child
for loop
works fine in 0.15
Metadata
Metadata
Assignees
Labels
A-ECSEntities, components, systems, and eventsEntities, components, systems, and eventsC-BugAn unexpected or incorrect behaviorAn unexpected or incorrect behaviorD-StraightforwardSimple bug fixes and API improvements, docs, test and examplesSimple bug fixes and API improvements, docs, test and examplesP-RegressionFunctionality that used to work but no longer does. Add a test for this!Functionality that used to work but no longer does. Add a test for this!S-Ready-For-ImplementationThis issue is ready for an implementation PR. Go for it!This issue is ready for an implementation PR. Go for it!