From 7b00c136a12ab25724ef7e2ce0be3bb5019cc27d Mon Sep 17 00:00:00 2001 From: Markus Sauermann <6299227+Sauermann@users.noreply.github.com> Date: Sat, 2 Dec 2023 17:04:17 +0100 Subject: [PATCH] Fix SubViewport physics picking Apply the logic of `handle_input_locally` for physics picking. --- scene/main/viewport.cpp | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/scene/main/viewport.cpp b/scene/main/viewport.cpp index fe02d97586..03747b3b6b 100644 --- a/scene/main/viewport.cpp +++ b/scene/main/viewport.cpp @@ -738,6 +738,14 @@ void Viewport::_process_picking() { while (physics_picking_events.size()) { local_input_handled = false; + if (!handle_input_locally) { + Viewport *vp = this; + while (!Object::cast_to(vp) && vp->get_parent()) { + vp = vp->get_parent()->get_viewport(); + } + vp->local_input_handled = false; + } + Ref ev = physics_picking_events.front()->get(); physics_picking_events.pop_front();