diff --git a/crates/bevy_gizmos/Cargo.toml b/crates/bevy_gizmos/Cargo.toml index 1f404d1bfc..c1de381454 100644 --- a/crates/bevy_gizmos/Cargo.toml +++ b/crates/bevy_gizmos/Cargo.toml @@ -25,6 +25,7 @@ bevy_core = { path = "../bevy_core", version = "0.12.0" } bevy_reflect = { path = "../bevy_reflect", version = "0.12.0" } bevy_core_pipeline = { path = "../bevy_core_pipeline", version = "0.12.0" } bevy_transform = { path = "../bevy_transform", version = "0.12.0" } +bevy_log = { path = "../bevy_log", version = "0.12.0" } [lints] workspace = true diff --git a/crates/bevy_gizmos/src/lib.rs b/crates/bevy_gizmos/src/lib.rs index 470ae26650..43c2c54726 100644 --- a/crates/bevy_gizmos/src/lib.rs +++ b/crates/bevy_gizmos/src/lib.rs @@ -90,6 +90,10 @@ pub struct GizmoPlugin; impl Plugin for GizmoPlugin { fn build(&self, app: &mut bevy_app::App) { + // Gizmos cannot work without either a 3D or 2D renderer. + #[cfg(all(not(feature = "bevy_pbr"), not(feature = "bevy_sprite")))] + bevy_log::error!("bevy_gizmos requires either bevy_pbr or bevy_sprite. Please enable one."); + load_internal_asset!(app, LINE_SHADER_HANDLE, "lines.wgsl", Shader::from_wgsl); app.register_type::()