From d32348c6862bdf112a2e9794df2cb12d8c1586f6 Mon Sep 17 00:00:00 2001 From: jsjtxietian Date: Mon, 4 Sep 2023 19:22:20 +0800 Subject: [PATCH] Reload built-in script after create to allow dropping nodes into it --- editor/script_create_dialog.cpp | 2 ++ 1 file changed, 2 insertions(+) diff --git a/editor/script_create_dialog.cpp b/editor/script_create_dialog.cpp index daac75552951..4f517abc9702 100644 --- a/editor/script_create_dialog.cpp +++ b/editor/script_create_dialog.cpp @@ -390,6 +390,8 @@ void ScriptCreateDialog::_create_new() { if (is_built_in) { scr->set_name(internal_name->get_text()); + // Make sure the script is compiled to make its type recognizable. + scr->reload(); } else { String lpath = ProjectSettings::get_singleton()->localize_path(file_path->get_text()); scr->set_path(lpath);