Skip to content

Commit

Permalink
Fix Physics Picking captured Object initialization
Browse files Browse the repository at this point in the history
Initialize variables when a captured object is known.
  • Loading branch information
Sauermann committed Jun 17, 2023
1 parent a83eb16 commit 5b2a5cd
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions scene/main/viewport.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -839,6 +839,9 @@ void Viewport::_process_picking() {
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())) {
physics_object_capture = ObjectID();
} else {
last_id = physics_object_capture;
last_object = capture_object;
}
}

Expand Down

0 comments on commit 5b2a5cd

Please sign in to comment.