From 5b2a5cd2e02dbb690cc96ff5e9268f6c4dd3d05b Mon Sep 17 00:00:00 2001 From: Markus Sauermann <6299227+Sauermann@users.noreply.github.com> Date: Sun, 18 Jun 2023 00:14:41 +0200 Subject: [PATCH] Fix Physics Picking captured Object initialization Initialize variables when a captured object is known. --- scene/main/viewport.cpp | 3 +++ 1 file changed, 3 insertions(+) diff --git a/scene/main/viewport.cpp b/scene/main/viewport.cpp index b395c908439..869a978cd02 100644 --- a/scene/main/viewport.cpp +++ b/scene/main/viewport.cpp @@ -839,6 +839,9 @@ void Viewport::_process_picking() { capture_object = Object::cast_to(ObjectDB::get_instance(physics_object_capture)); if (!capture_object || !camera_3d || (mb.is_valid() && mb->get_button_index() == MouseButton::LEFT && !mb->is_pressed())) { physics_object_capture = ObjectID(); + } else { + last_id = physics_object_capture; + last_object = capture_object; } }