summaryrefslogtreecommitdiff
path: root/editor/plugins
diff options
context:
space:
mode:
authorRĂ©mi Verschelde <remi@verschelde.fr>2022-07-30 18:22:52 +0200
committerGitHub <noreply@github.com>2022-07-30 18:22:52 +0200
commitcca072aa8672633a235e9187ee6873d9f165e003 (patch)
treec8e762aa5016c0674102344aba4d0d3dc0f63464 /editor/plugins
parent5595f2406a743a5a8f85d7e5642efa3c5ca18702 (diff)
parent2f46749f4e53420894f648873e01fd91ce8bcf3f (diff)
Merge pull request #63679 from PrecisionRender/master
Fix `ShapeCast3D` creating runtime shape in editor
Diffstat (limited to 'editor/plugins')
-rw-r--r--editor/plugins/node_3d_editor_gizmos.cpp5
1 files changed, 4 insertions, 1 deletions
diff --git a/editor/plugins/node_3d_editor_gizmos.cpp b/editor/plugins/node_3d_editor_gizmos.cpp
index 5c66026c1b..0070226d40 100644
--- a/editor/plugins/node_3d_editor_gizmos.cpp
+++ b/editor/plugins/node_3d_editor_gizmos.cpp
@@ -2569,9 +2569,12 @@ void ShapeCast3DGizmoPlugin::redraw(EditorNode3DGizmo *p_gizmo) {
const Ref<StandardMaterial3D> material = shapecast->is_enabled() ? shapecast->get_debug_material() : get_material("shape_material_disabled");
- p_gizmo->add_lines(shapecast->get_debug_shape_vertices(), material);
p_gizmo->add_lines(shapecast->get_debug_line_vertices(), material);
+ if (shapecast->get_shape().is_valid()) {
+ p_gizmo->add_lines(shapecast->get_debug_shape_vertices(), material);
+ }
+
p_gizmo->add_collision_segments(shapecast->get_debug_line_vertices());
}