diff --git a/addons/pandora/model/type.gd b/addons/pandora/model/type.gd index 3a43d41..8798147 100644 --- a/addons/pandora/model/type.gd +++ b/addons/pandora/model/type.gd @@ -73,8 +73,9 @@ static func lookup(name: String) -> PandoraPropertyType: if ResourceLoader.exists(type_path): var ScriptType = load(type_path) - if ScriptType != null and ScriptType.has_source_code(): - return ScriptType.new() + if ScriptType != null: + if ScriptType.has_source_code() or ScriptType.can_instantiate(): + return ScriptType.new() return UndefinedType.new() diff --git a/addons/pandora/util/script_util.gd b/addons/pandora/util/script_util.gd index 56f7112..995aded 100644 --- a/addons/pandora/util/script_util.gd +++ b/addons/pandora/util/script_util.gd @@ -39,7 +39,7 @@ static func create_entity_from_script( static func _get_entity_class(path: String) -> GDScript: var EntityClass = load(path) - if EntityClass == null: + if EntityClass == null or not EntityClass.can_instantiate(): push_warning("Unable to find " + path + " - defaulting to PandoraEntity instead.") EntityClass = PandoraEntityScript return EntityClass