-
-
Notifications
You must be signed in to change notification settings - Fork 3.9k
TextBundle does not recognize it is a child of a NodeBundle #6959
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Comments
I can't reproduce with the minimal example you provided. Is there other code than what you posted? Could I take a look at it? It's fine if it's not minimal, as long as I can reproduce the error message |
I just figured out what the problem was. I was using a helper system that I labeled To show how this happened, first we have the function responsible for registering these systems with the app: app.add_enter_system_set(
AppState::WaitingForMusic,
SystemSet::new()
.with_system(utils::despawn_recursive::<MenuComponent>)
.with_system(setup_dnd_ui),
)
.add_system(wait_for_drop.run_in_state(AppState::WaitingForMusic)); You can see my helper system pub fn despawn_recursive<T: Component>(mut commands: Commands, query: Query<Entity, With<T>>) {
for entity in query.iter() {
commands.entity(entity).despawn();
}
} I must use commands
.spawn((
NodeBundle {
style: Style {
size: Size::new(Val::Px(450.0), Val::Px(300.0)),
flex_direction: FlexDirection::Column,
justify_content: JustifyContent::Center,
margin: UiRect::all(Val::Auto),
..default()
},
..default()
},
MenuComponent,
))
.with_children(|parent| {
...
}); Changing this to |
It is a bug to have an entity with a |
|
Should this be closed as "working as intended" or renamed to "Bug: |
At the very least this could be closed as a duplicate of #5584. |
Bevy version
0.9.1
What you did
Spawning the following two entities causes the console to be flooded with warning messages that appear to be incorrect:
Some context, as I imagine this may not be reproducible from just this code: This setup function runs immediately after despawning every entity in the world, so it should be a fresh start (and using
bevy_inspector_egui
correctly demonstrates this). The only two existing entities in the world after this command are aCamera2DBundle
and the root UI node, with it'sTextBundle
child:What went wrong
The console gets flooded with warnings stating that a style component has a parent which is not style, but this is not the case. The only entity with a parent has a ui node as it's parent.
Additional information
This message only appears after despawning a previous UI hierarchy and then spawning this one. I cannot figure out how to make a minimum reproducible example because I have no idea what is causing this to happen.
The text was updated successfully, but these errors were encountered: