summaryrefslogtreecommitdiff
path: root/scene
diff options
context:
space:
mode:
authorPrecisionRender <austin08dean@gmail.com>2022-07-30 10:21:53 -0500
committerPrecisionRender <austin08dean@gmail.com>2022-07-30 10:21:53 -0500
commit2f46749f4e53420894f648873e01fd91ce8bcf3f (patch)
tree1ba1370976535d8edf418ad2c46818c1b7d5bc0a /scene
parent335fc2a94675de9c063743301fe4ce02bf344d63 (diff)
Fix `ShapeCast3D` creating runtime shape in editor
Diffstat (limited to 'scene')
-rw-r--r--scene/3d/shape_cast_3d.cpp8
1 files changed, 6 insertions, 2 deletions
diff --git a/scene/3d/shape_cast_3d.cpp b/scene/3d/shape_cast_3d.cpp
index df8bd7dfc9..ac804280fe 100644
--- a/scene/3d/shape_cast_3d.cpp
+++ b/scene/3d/shape_cast_3d.cpp
@@ -577,14 +577,18 @@ void ShapeCast3D::_update_debug_shape() {
_create_debug_shape();
}
+ _update_debug_shape_vertices();
+
+ if (Engine::get_singleton()->is_editor_hint()) {
+ return;
+ }
+
MeshInstance3D *mi = static_cast<MeshInstance3D *>(debug_shape);
Ref<ArrayMesh> mesh = mi->get_mesh();
if (!mesh.is_valid()) {
return;
}
- _update_debug_shape_vertices();
-
mesh->clear_surfaces();
Array a;