From 4077129f9db9d220b444ec05cefd359009cfa0d9 Mon Sep 17 00:00:00 2001 From: yds Date: Wed, 17 Apr 2024 11:21:53 -0300 Subject: [PATCH] Fix RayCast3D's debug draw transform not updating --- scene/3d/physics/ray_cast_3d.cpp | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/scene/3d/physics/ray_cast_3d.cpp b/scene/3d/physics/ray_cast_3d.cpp index 0cb722a77eb..a9272388c10 100644 --- a/scene/3d/physics/ray_cast_3d.cpp +++ b/scene/3d/physics/ray_cast_3d.cpp @@ -204,8 +204,10 @@ void RayCast3D::_notification(int p_what) { bool prev_collision_state = collided; _update_raycast_state(); - if (prev_collision_state != collided && get_tree()->is_debugging_collisions_hint()) { - _update_debug_shape_material(true); + if (get_tree()->is_debugging_collisions_hint()) { + if (prev_collision_state != collided) { + _update_debug_shape_material(true); + } if (is_inside_tree() && debug_instance.is_valid()) { RenderingServer::get_singleton()->instance_set_transform(debug_instance, get_global_transform()); }