diff --git a/editor/editor_properties.cpp b/editor/editor_properties.cpp index 935915a0c080..3a813c091e38 100644 --- a/editor/editor_properties.cpp +++ b/editor/editor_properties.cpp @@ -3228,8 +3228,9 @@ void EditorPropertyResource::_viewport_selected(const NodePath &p_path) { return; } - Ref vt; - vt.instantiate(); + Ref vt = get_edited_property_value(); + ERR_FAIL_COND(vt.is_null()); + vt->set_viewport_path_in_scene(get_tree()->get_edited_scene_root()->get_path_to(to_node)); emit_changed(get_edited_property(), vt);