From 3143f5fcc5b4500a886aedb50eb4c8ab7f557a41 Mon Sep 17 00:00:00 2001 From: Hugo Locurcio Date: Sat, 19 Jun 2021 09:12:58 +0200 Subject: [PATCH] Use double-sided material for RayCast This makes RayCasts visible if the camera is fully inside one (e.g. a RayCast parented to the current Camera). --- scene/3d/ray_cast.cpp | 2 ++ 1 file changed, 2 insertions(+) diff --git a/scene/3d/ray_cast.cpp b/scene/3d/ray_cast.cpp index 535e4aab2be..f4820853806 100644 --- a/scene/3d/ray_cast.cpp +++ b/scene/3d/ray_cast.cpp @@ -415,6 +415,8 @@ void RayCast::_update_debug_shape_material(bool p_check_collision) { material->set_flag(SpatialMaterial::FLAG_UNSHADED, true); material->set_feature(SpatialMaterial::FEATURE_TRANSPARENT, true); + // Use double-sided rendering so that the RayCast can be seen if the camera is inside. + material->set_cull_mode(SpatialMaterial::CULL_DISABLED); } Color color = debug_shape_custom_color;