Instance the proper base type when using scripts in mat maker gd editor.

This commit is contained in:
Relintai 2022-06-15 13:40:46 +02:00
parent 3e26ea2975
commit 76464a0509

View File

@ -268,7 +268,10 @@ void MatMakerGDEditor::_on_AddPopup_ok_pressed(const int type, const String &dat
Ref<Script> script = ResourceLoader::load(data);
if (script.is_valid() && script->can_instance()) {
nnode.instance();
nnode = Ref<MMNode>(ClassDB::instance(script->get_instance_base_type()));
ERR_FAIL_COND(!nnode.is_valid());
nnode->set_script(script.get_ref_ptr());
}
}