From 2f46749f4e53420894f648873e01fd91ce8bcf3f Mon Sep 17 00:00:00 2001 From: PrecisionRender Date: Sat, 30 Jul 2022 10:21:53 -0500 Subject: Fix `ShapeCast3D` creating runtime shape in editor --- editor/plugins/node_3d_editor_gizmos.cpp | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'editor/plugins') 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 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()); } -- cgit v1.2.3