diff options
author | Rémi Verschelde <rverschelde@gmail.com> | 2023-01-08 22:38:29 +0100 |
---|---|---|
committer | Rémi Verschelde <rverschelde@gmail.com> | 2023-01-08 22:38:29 +0100 |
commit | 0d6fede757057979620188a2cf779b041c453187 (patch) | |
tree | 5c998b799b19af79bb9e4fe069f985faccbdd6c0 | |
parent | 495ec2130e5b32fd45921578917874f1f3d6176a (diff) | |
parent | 256e250c87cd88c104192460e4d0028e53003dd1 (diff) |
Merge pull request #69809 from KoBeWi/runtime_enabler_2d
Fix VisibleOnScreenEnabler disabling in editor
-rw-r--r-- | scene/2d/visible_on_screen_notifier_2d.cpp | 2 | ||||
-rw-r--r-- | scene/3d/visible_on_screen_notifier_3d.cpp | 2 |
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 9a3fe73be1..237eb3d987 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 60a0b03c0d..afddfdb749 100644 --- a/scene/3d/visible_on_screen_notifier_3d.cpp +++ b/scene/3d/visible_on_screen_notifier_3d.cpp @@ -128,7 +128,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) { |