From 5b71c0244bc0e6e14f1c842ca474c652f0c7f6d0 Mon Sep 17 00:00:00 2001 From: Stepan Koltsov Date: Thu, 28 Dec 2023 03:34:19 +0000 Subject: [PATCH] Explain Camera2dBundle.projection needs to be set carefully --- crates/bevy_core_pipeline/src/core_2d/camera_2d.rs | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/crates/bevy_core_pipeline/src/core_2d/camera_2d.rs b/crates/bevy_core_pipeline/src/core_2d/camera_2d.rs index fcd794029b04f..c05692e9d726b 100644 --- a/crates/bevy_core_pipeline/src/core_2d/camera_2d.rs +++ b/crates/bevy_core_pipeline/src/core_2d/camera_2d.rs @@ -23,6 +23,10 @@ pub struct Camera2d { pub struct Camera2dBundle { pub camera: Camera, pub camera_render_graph: CameraRenderGraph, + /// Note: default value for `OrthographicProjection.near` is `0.0` + /// which makes objects on the screen plane invisible to 2D camera. + /// `Camera2dBundle::default()` sets `near` to negative value, + /// so be careful when initializing this field manually. pub projection: OrthographicProjection, pub visible_entities: VisibleEntities, pub frustum: Frustum,