From 915e39b3c914ccd75713e50ba067cfe6f488c5b1 Mon Sep 17 00:00:00 2001 From: Ainsley Date: Thu, 20 Jun 2024 12:41:11 +0800 Subject: [PATCH] Use `_camera_3d_set` instead of change camera_3d directly --- scene/main/viewport.cpp | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/scene/main/viewport.cpp b/scene/main/viewport.cpp index 468d4e3c0fa..4d75e06ff9b 100644 --- a/scene/main/viewport.cpp +++ b/scene/main/viewport.cpp @@ -4251,8 +4251,7 @@ bool Viewport::_camera_3d_add(Camera3D *p_camera) { void Viewport::_camera_3d_remove(Camera3D *p_camera) { camera_3d_set.erase(p_camera); if (camera_3d == p_camera) { - camera_3d->notification(Camera3D::NOTIFICATION_LOST_CURRENT); - camera_3d = nullptr; + _camera_3d_set(nullptr); } }