From 5de6376a223ee4161182a795924e859543a4de5c Mon Sep 17 00:00:00 2001 From: jmb462 Date: Tue, 24 Aug 2021 11:24:02 +0200 Subject: [PATCH] Fix Raycast3D color update when not colliding anymore --- scene/3d/ray_cast.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scene/3d/ray_cast.cpp b/scene/3d/ray_cast.cpp index f9d77f77c54..d9391833afe 100644 --- a/scene/3d/ray_cast.cpp +++ b/scene/3d/ray_cast.cpp @@ -427,7 +427,7 @@ void RayCast::_update_debug_shape_material(bool p_check_collision) { color = get_tree()->get_debug_collisions_color(); } - if (p_check_collision) { + if (p_check_collision && collided) { if ((color.get_h() < 0.055 || color.get_h() > 0.945) && color.get_s() > 0.5 && color.get_v() > 0.5) { // If base color is already quite reddish, hightlight collision with green color color = Color(0.0, 1.0, 0.0, color.a);