Merge pull request #50112 from lawnjelly/camera_2d_current

Most recently added current Camera2D takes precedence
This commit is contained in:
Rémi Verschelde 2021-07-22 12:16:44 +02:00 committed by GitHub
commit e3c545668b
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 6 additions and 2 deletions

View File

@ -248,9 +248,13 @@ void Camera2D::_notification(int p_what) {
canvas = get_canvas(); canvas = get_canvas();
_setup_viewport(); _setup_viewport();
_update_process_mode(); _update_process_mode();
_update_scroll();
// if a camera enters the tree that is set to current,
// it should take over as the current camera, and mark
// all other cameras as non current
_set_current(current);
first = true; first = true;
} break; } break;