Skip to content

Commit

Permalink
Merge pull request #81299 from jsjtxietian/Reload-built_in-script-aft…
Browse files Browse the repository at this point in the history
…er-create-to-allow-drag-nodes-into-it

Fix an error when dragging nodes into built-in scripts because script does not inherit Node
  • Loading branch information
YuriSizov committed Sep 6, 2023
2 parents c5562d1 + d32348c commit d2cc689
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions editor/script_create_dialog.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -391,6 +391,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);
Expand Down

0 comments on commit d2cc689

Please sign in to comment.