Skip to content

Children are invisible unless parent has Visibility and ComputedInvisibility #5334

@rparrett

Description

@rparrett

Bevy version

main, also
c8aa047 (commit prior to #5310)

What you did

use bevy::prelude::*;

fn main() {
    App::new()
        .add_plugins(DefaultPlugins)
        .add_startup_system(setup)
        .run();
}

fn setup(mut commands: Commands, asset_server: Res<AssetServer>) {
    commands.spawn_bundle(Camera2dBundle::default());
    commands
        .spawn_bundle(TransformBundle::default())
        // .insert(ComputedVisibility::default())
        // .insert(Visibility::default())
        .with_children(|parent| {
            parent.spawn_bundle(SpriteBundle {
                texture: asset_server.load("branding/icon.png"),
                ..default()
            });
        });
}

What went wrong

Prior to #5310, the above code worked as-is and displayed the bevy logo.

After #5310, the logo is not displayed unless the two commented-out lines are uncommented.

Additional information

If this is expected behavior, we should mention that in the migration guide and close this.

This may have implications for other bits of documentation / examples.

Metadata

Metadata

Assignees

No one assigned

    Labels

    C-BugAn unexpected or incorrect behaviorS-Needs-TriageThis issue needs to be labelled

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions