リソースを動的にロードしようとしています。パソコンでは正常に動作しますが、androidでは以下のエラーが発生します。
組み込み関数 'dict2inst' の型が無効です。引数 1 を Nil から Dictionary に変換できません。
以前にエクスポートした Curve2D を読み込もうとしています。コードは次のとおりです。
extends Node
var paths = []
const path_dir = "res://paths/"
func _ready():
load_paths()
pass
func random_path():
return paths[randi() % paths.size()]
func load_paths():
var dir = Directory.new()
dir.change_dir(path_dir)
dir.list_dir_begin()
var path_file = dir.get_next()
var path
while path_file != "":
if dir.current_is_dir():
pass
else:
print("loading: " + path_dir + path_file)
path = load(path_dir + path_file)
if path && path is Curve2D: #error occours here
paths.append(path)
path_file = dir.get_next()