You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I tested it on an Nvidia RTX 3070ti with Vulkan as the backend as well and did have the same issue.
What you did
I tried to spawn an entity as a child of another entity but it was not visible. After downgrading to 0.7.0 everything went fine. Thus I assume that this is a regression introduced with 0.8.
The code to reproduce:
use bevy::prelude::*;constRECT_SIZE:f32 = 16.0;fnmain(){App::new().add_plugins(DefaultPlugins).add_startup_system(spawn_camera).add_startup_system(spawn_as_child).run();}fnspawn_camera(mutcommands:Commands){
commands.spawn_bundle(Camera2dBundle::default());// use OrthographicCameraBundle::new_2d() in 0.7.0}fnspawn_as_child(mutcommands:Commands){let rect_entity = commands
.spawn_bundle(SpriteBundle{sprite:Sprite{color:Color::RED,custom_size:Some(Vec2::splat(RECT_SIZE)),
..Default::default()},
..Default::default()}).insert(Transform::default()).id();
commands
.spawn().insert_bundle(TransformBundle::default()).add_child(rect_entity);}
What went wrong
The sprite spawned is not visible in 0.8.1:
I expected to see a red rectangle as you do in version 0.7.0:
The text was updated successfully, but these errors were encountered:
// replace this line when spawning the parent entity.insert_bundle(TransformBundle::default())// by the following line.insert_bundle(SpatialBundle::default())
Thanks, you saved my day 🙂 Using SpatialBundle worked. This issue was driving me nuts yesterday. I did try using the Visibility component before already but it did not work. I did not know about the ComputedVisibility component.
Don't worry, you are not the only one. I've counted a dozen people that got very frustrated by that. (including me, twice) I'm glad the warning message will make it to 0.9.0
Bevy version
0.8.1 (I also tested on master branch (39467e3) and did have the sam issue)
[Optional] Relevant system information
Rust version: 1.64.0
OS: Windows 11 & Mac OS Monterey 12.6
I tested it on an Nvidia RTX 3070ti with Vulkan as the backend as well and did have the same issue.
What you did
I tried to spawn an entity as a child of another entity but it was not visible. After downgrading to
0.7.0
everything went fine. Thus I assume that this is a regression introduced with0.8
.The code to reproduce:
What went wrong
The sprite spawned is not visible in

0.8.1
:I expected to see a red rectangle as you do in version

0.7.0
:The text was updated successfully, but these errors were encountered: