Hi, Been trying to display the bounding boxes of my entities tagged with Debuggable. The query itself seems to fetch them, and when i add children (supposedly a red box?) nothing happens, the hitbox_q counter goes up for each time i try to apply them, but they're not removed nor visible.
Side quest: I get this error when i try to run the debugger in rostrover to inspect whats going on. How do i handle this?
Here's the debug plugin
fn build(app: &mut App) {
app.add_plugins(FpsOverlayPlugin {
config: FpsOverlayConfig {
text_config: TextFont {
font_size: 22.0,
font: default(),
font_smoothing: FontSmoothing::default(),
},
text_color: OverlayColor::GREEN,
enabled: true,
}
})
.add_systems(Update, customize_config);
}
fn customize_config(
mut commands: Commands,
input: Res<ButtonInput<KeyCode>>,
mut overlay: ResMut<FpsOverlayConfig>,
debug_q: Query<(Entity, &Transform), With<Debuggable>>,
hitbox_q: Query<Entity, With<Hitbox>>,
) {
if input.just_pressed(KeyCode::Digit1) {
overlay.enabled = !overlay.enabled;
}
if input.just_pressed(KeyCode::Digit2) {
for (entity, transform) in debug_q.iter() {
let has_hitbox = hitbox_q.get(entity).is_ok();
if has_hitbox {
if let Ok(child) = hitbox_q.get(entity) {
commands.entity(entity).despawn();
}
} else {
commands.entity(entity).with_child((
Sprite {
color: Color::srgba(1.0, 0.0, 0.0, 0.5),
custom_size: Some(Vec2::new(transform.scale.x, transform.scale.y)),
..default()
},
Hitbox
));
}
}
}
}```
Bird is defined like this:
```rs
fn spawn_player(mut commands: Commands, asset_server: Res<AssetServer>) {
commands.spawn((
Bird::default(),
Sprite {
image: asset_server.load("bird.png"),
..default()
},
Transform {
translation: Vec3::new(300., 450., 0.),
..default()
},
Debuggable,
));
}``` (Bird is just speed & rotation floats)