summaryrefslogtreecommitdiff
path: root/scene/3d
diff options
context:
space:
mode:
authorPouleyKetchoupp <pouleyketchoup@gmail.com>2021-03-24 19:41:19 -0700
committerPouleyKetchoupp <pouleyketchoup@gmail.com>2021-03-24 19:41:19 -0700
commit41994ff8ee0af0bf826ede93e6e9931109f0dede (patch)
treeee24669e665b7f031af466256c6082ee9e4c4387 /scene/3d
parent9a64d6b2b2001920affdaedd0fb8c0bc6074b13a (diff)
Fix RayCast3D color in game with no collision
In game, the ray color was always set as colliding.
Diffstat (limited to 'scene/3d')
-rw-r--r--scene/3d/ray_cast_3d.cpp2
1 files changed, 1 insertions, 1 deletions
diff --git a/scene/3d/ray_cast_3d.cpp b/scene/3d/ray_cast_3d.cpp
index 66f3e539a2..1bc5e10f90 100644
--- a/scene/3d/ray_cast_3d.cpp
+++ b/scene/3d/ray_cast_3d.cpp
@@ -426,7 +426,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);