diff --git a/doc/classes/ScriptExtension.xml b/doc/classes/ScriptExtension.xml index 0a4b81d442e..17742534b18 100644 --- a/doc/classes/ScriptExtension.xml +++ b/doc/classes/ScriptExtension.xml @@ -162,7 +162,7 @@ - Returns [code]true[/code] if the script is an abstract script. An abstract script does not have a constructor and cannot be instantiated. + Returns [code]true[/code] if the script is an abstract script. Abstract scripts cannot be instantiated directly, instead other scripts should inherit them. Abstract scripts will be either unselectable or hidden in the Create New Node dialog (unselectable if there are non-abstract classes inheriting it, otherwise hidden). diff --git a/editor/create_dialog.cpp b/editor/create_dialog.cpp index 1301960ad1c..906f1a2a4a9 100644 --- a/editor/create_dialog.cpp +++ b/editor/create_dialog.cpp @@ -219,6 +219,10 @@ bool CreateDialog::_should_hide_type(const StringName &p_type) const { i = script_path.find_char('/', i + 1); } } + // Abstract scripts cannot be instantiated. + String path = ScriptServer::get_global_class_path(p_type); + Ref