Browse Source

Merge pull request #47348 from nekomatata/raycast-3d-collide-fix

Fix RayCast3D color in game with no collision
Rémi Verschelde 4 years ago
parent
commit
b283447bfd
1 changed files with 1 additions and 1 deletions
  1. 1 1
      scene/3d/ray_cast_3d.cpp

+ 1 - 1
scene/3d/ray_cast_3d.cpp

@@ -428,7 +428,7 @@ void RayCast3D::_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, highlight collision with green color
 			color = Color(0.0, 1.0, 0.0, color.a);