summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorkobewi <kobewi4e@gmail.com>2022-12-09 15:42:47 +0100
committerkobewi <kobewi4e@gmail.com>2022-12-14 00:25:53 +0100
commit256e250c87cd88c104192460e4d0028e53003dd1 (patch)
treece118f10f316f1b0fdc6139b60d85f8f85616ea0
parentc7c561ffd5d0e46cd1db3dbb583c6ca3841ab894 (diff)
Fix VisibleOnScreenEnabler disabling in editor
-rw-r--r--scene/2d/visible_on_screen_notifier_2d.cpp2
-rw-r--r--scene/3d/visible_on_screen_notifier_3d.cpp2
2 files changed, 2 insertions, 2 deletions
diff --git a/scene/2d/visible_on_screen_notifier_2d.cpp b/scene/2d/visible_on_screen_notifier_2d.cpp
index 263c3a12a2..aa048b3f43 100644
--- a/scene/2d/visible_on_screen_notifier_2d.cpp
+++ b/scene/2d/visible_on_screen_notifier_2d.cpp
@@ -137,7 +137,7 @@ void VisibleOnScreenEnabler2D::set_enable_node_path(NodePath p_path) {
return;
}
enable_node_path = p_path;
- if (is_inside_tree()) {
+ if (is_inside_tree() && !Engine::get_singleton()->is_editor_hint()) {
node_id = ObjectID();
Node *node = get_node(enable_node_path);
if (node) {
diff --git a/scene/3d/visible_on_screen_notifier_3d.cpp b/scene/3d/visible_on_screen_notifier_3d.cpp
index 6d4c18a69e..5ac00b3a7a 100644
--- a/scene/3d/visible_on_screen_notifier_3d.cpp
+++ b/scene/3d/visible_on_screen_notifier_3d.cpp
@@ -127,7 +127,7 @@ void VisibleOnScreenEnabler3D::set_enable_node_path(NodePath p_path) {
return;
}
enable_node_path = p_path;
- if (is_inside_tree()) {
+ if (is_inside_tree() && !Engine::get_singleton()->is_editor_hint()) {
node_id = ObjectID();
Node *node = get_node(enable_node_path);
if (node) {