diff --git a/editor/plugins/spatial_editor_plugin.cpp b/editor/plugins/spatial_editor_plugin.cpp index 783338e77..c697a7345 100644 --- a/editor/plugins/spatial_editor_plugin.cpp +++ b/editor/plugins/spatial_editor_plugin.cpp @@ -580,7 +580,7 @@ ObjectID SpatialEditorViewport::_select_ray(const Point2 &p_pos) { RBSet> found_gizmos; Node *edited_scene = get_tree()->get_edited_scene_root(); - ObjectID closest; + ObjectID closest = ObjectID(); Node *item = nullptr; float closest_dist = 1e20;