Merge pull request #78383 from Sauermann/fix-physics-object-init

Fix Physics Picking captured Object initialization
This commit is contained in:
Yuri Sizov 2023-07-12 17:15:45 +02:00
commit 223370cb64

View file

@ -841,6 +841,9 @@ void Viewport::_process_picking() {
capture_object = Object::cast_to<CollisionObject3D>(ObjectDB::get_instance(physics_object_capture)); capture_object = Object::cast_to<CollisionObject3D>(ObjectDB::get_instance(physics_object_capture));
if (!capture_object || !camera_3d || (mb.is_valid() && mb->get_button_index() == MouseButton::LEFT && !mb->is_pressed())) { if (!capture_object || !camera_3d || (mb.is_valid() && mb->get_button_index() == MouseButton::LEFT && !mb->is_pressed())) {
physics_object_capture = ObjectID(); physics_object_capture = ObjectID();
} else {
last_id = physics_object_capture;
last_object = capture_object;
} }
} }