summaryrefslogtreecommitdiff
path: root/scene/3d/mesh_instance.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'scene/3d/mesh_instance.cpp')
-rw-r--r--scene/3d/mesh_instance.cpp13
1 files changed, 7 insertions, 6 deletions
diff --git a/scene/3d/mesh_instance.cpp b/scene/3d/mesh_instance.cpp
index 14886f4b7a..62e1a95209 100644
--- a/scene/3d/mesh_instance.cpp
+++ b/scene/3d/mesh_instance.cpp
@@ -340,12 +340,13 @@ void MeshInstance::create_debug_tagents() {
mi->set_mesh(am);
mi->set_name("DebugTangents");
add_child(mi);
- if (get_parent()) {
- if (get_parent() == get_tree()->get_edited_scene_root())
- mi->set_owner(get_parent());
- else
- mi->set_owner(get_parent()->get_owner());
- }
+#ifdef TOOLS_ENABLED
+
+ if (this == get_tree()->get_edited_scene_root())
+ mi->set_owner(this);
+ else
+ mi->set_owner(get_owner());
+#endif
}
}