diff --git a/editor/gui/create_dialog.cpp b/editor/gui/create_dialog.cpp index c0dfd12b4b2..a6fdf977563 100644 --- a/editor/gui/create_dialog.cpp +++ b/editor/gui/create_dialog.cpp @@ -620,7 +620,16 @@ String CreateDialog::get_selected_type() { } String type = selected->get_text(0).get_slicec(' ', 0); - return ClassDB::class_exists(type) ? type : String(selected->get_meta("_script_path", "")); + if (ClassDB::class_exists(type)) { + return type; // CPP type - from the core or GDExtensions + } + + const EditorData::CustomType *custom_type = EditorNode::get_editor_data().get_custom_type_by_name(type); + if (custom_type != nullptr) { + return custom_type->script->get_path(); // Types via EditorPlugin::add_custom_type() + } + + return String(selected->get_meta("_script_path", "")); // Script types } void CreateDialog::set_base_type(const String &p_base) {