Skip to content
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

ChildBuilder does not respect required components #16380

Closed
Hexorg opened this issue Nov 13, 2024 · 3 comments
Closed

ChildBuilder does not respect required components #16380

Hexorg opened this issue Nov 13, 2024 · 3 comments
Assignees
Labels
A-ECS Entities, components, systems, and events A-Hierarchy Parent-child entity hierarchies C-Bug An unexpected or incorrect behavior P-High This is particularly urgent, and deserves immediate attention
Milestone

Comments

@Hexorg
Copy link
Contributor

Hexorg commented Nov 13, 2024

Bevy version

"0.15.0-rc.3"

What you did

I ran this setup function for Startup schedule:

fn setup(mut commands:Commands) {
    let mut e = commands.spawn_empty();
    e.insert(Transform::default());
    e.with_children(|b| {
        b.spawn((PointLight::default(), Transform::IDENTITY));
    });
}

What went wrong

Expected result: No warning messages.

Result I get:

2024-11-13T22:31:15.585476Z  WARN bevy_hierarchy::valid_parent_check_plugin: warning[B0004]: Entity 7v1 with the InheritedVisibility component has a parent without InheritedVisibility.
This will cause inconsistent behaviors! See: https://bevyengine.org/learn/errors/b0

I checked and Entity 7v1 is the child

@Hexorg Hexorg added C-Bug An unexpected or incorrect behavior S-Needs-Triage This issue needs to be labelled labels Nov 13, 2024
@Hexorg Hexorg added this to the 0.15 milestone Nov 13, 2024
@alice-i-cecile
Copy link
Member

alice-i-cecile commented Nov 13, 2024

Here's a link to the relevant source:

fn with_children(&mut self, spawn_children: impl FnOnce(&mut Self::Builder<'_>)) -> &mut Self {

I bet this is #16034 again. Can you test this on #16219?

@alice-i-cecile alice-i-cecile added A-ECS Entities, components, systems, and events P-High This is particularly urgent, and deserves immediate attention A-Hierarchy Parent-child entity hierarchies and removed S-Needs-Triage This issue needs to be labelled labels Nov 13, 2024
@Hexorg
Copy link
Contributor Author

Hexorg commented Nov 13, 2024

Just downloaded and built nakedible/bevy world-entity-mut-flushes branch but still get the same warning.

@cart
Copy link
Member

cart commented Nov 13, 2024

This isn't broken behavior. The parent doesn't have InheritedVisibility. Transform does not require Visibility. You need to insert Visibility on the parent, which will pull in InheritedVisibility.

@alice-i-cecile alice-i-cecile closed this as not planned Won't fix, can't repro, duplicate, stale Nov 13, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-ECS Entities, components, systems, and events A-Hierarchy Parent-child entity hierarchies C-Bug An unexpected or incorrect behavior P-High This is particularly urgent, and deserves immediate attention
Projects
None yet
Development

No branches or pull requests

3 participants