diff --git a/crates/bevy_render/src/camera.rs b/crates/bevy_render/src/camera.rs index 346762aecc..03564a80fe 100644 --- a/crates/bevy_render/src/camera.rs +++ b/crates/bevy_render/src/camera.rs @@ -433,6 +433,17 @@ pub fn extract_cameras( mapper: Extract>, ) { let primary_window = primary_window.iter().next(); + type ExtractedCameraComponents = ( + ExtractedCamera, + ExtractedView, + RenderVisibleEntities, + TemporalJitter, + MipBias, + RenderLayers, + Projection, + NoIndirectDrawing, + ViewUniformOffset, + ); for ( main_entity, render_entity, @@ -452,17 +463,9 @@ pub fn extract_cameras( ) in query.iter() { if !camera.is_active { - commands.entity(render_entity).remove::<( - ExtractedCamera, - ExtractedView, - RenderVisibleEntities, - TemporalJitter, - MipBias, - RenderLayers, - Projection, - NoIndirectDrawing, - ViewUniformOffset, - )>(); + commands + .entity(render_entity) + .remove::(); continue; } @@ -481,6 +484,9 @@ pub fn extract_cameras( camera.physical_target_size(), ) { if target_size.x == 0 || target_size.y == 0 { + commands + .entity(render_entity) + .remove::(); continue; }