Skip to content

Commit

Permalink
Merge pull request #90800 from ydeltastar/fix-raycast3d-debug-draw
Browse files Browse the repository at this point in the history
Fix `RayCast3D`'s debug draw transform not updating
  • Loading branch information
akien-mga committed Apr 17, 2024
2 parents acd3d24 + 4077129 commit 61c967b
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions scene/3d/physics/ray_cast_3d.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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());
}
Expand Down

0 comments on commit 61c967b

Please sign in to comment.