diff --git a/cheat-library/src/user/cheat/visuals/HideUI.cpp b/cheat-library/src/user/cheat/visuals/HideUI.cpp index 4983d3f..b89216c 100644 --- a/cheat-library/src/user/cheat/visuals/HideUI.cpp +++ b/cheat-library/src/user/cheat/visuals/HideUI.cpp @@ -48,16 +48,18 @@ namespace cheat::feature if (ui_camera == nullptr) ui_camera = app::GameObject_Find(string_to_il2cppi("/UICamera"), nullptr); - if (ui_camera) + if (ui_camera->fields._.m_CachedPtr != nullptr) app::GameObject_SetActive(ui_camera, false, nullptr); } else { if (ui_camera) - { - app::GameObject_SetActive(ui_camera, true, nullptr); + { + if (ui_camera->fields._.m_CachedPtr != nullptr) + app::GameObject_SetActive(ui_camera, true, nullptr); + ui_camera = nullptr; - } + } } } } \ No newline at end of file