On Android it can't preload a scene. It works on Windows.
Code:
Touchscreenbutton:
func _on_TouchScreenButton_pressed():
hero.skill1android = true
hero:
func process_Android(delta):
if(skill1android == true and skill1_Activated == true):
skill1android = false
skill1_Activated = false
senpai()
func senpai():
print("3")
var senpai = preload("res://objects/senpai.scn").instance()
var pos = get_pos()
if(dir == "RIGHT"):
pos.x = pos.x + 100
pos.y = pos.y - 120
else:
pos.x = pos.x - 100
pos.y = pos.y - 120
senpai.set_pos(pos)
get_node("../..").add_child(senpai)
Logcat:
I/godot ( 3224): ERROR: start: Condition ' !scene ' is true. returned: false
I/godot ( 3224): At: main/main.cpp:1464.
I/godot ( 3224): ERROR: load_interactive: Condition ' err!=OK ' is true. returned: Ref<ResourceInteractiveLoader>()
I/godot ( 3224): At: core/io/resource_format_binary.cpp:1081.
I/godot ( 3224): ERROR: load: Method/Function Failed, returning: RES()
I/godot ( 3224): At: core/io/resource_loader.cpp:218.
I/godot ( 3224): ERROR: poll: Method/Function Failed, returning: error
I/godot ( 3224): At: core/io/resource_format_binary.cpp:681.
I/godot ( 3224): ERROR: load: Condition ' err!=OK ' is true. returned: RES()
I/godot ( 3224): At: core/io/resource_loader.cpp:142.
I/godot ( 3224): ERROR: load: Method/Function Failed, returning: RES()
I/godot ( 3224): At: core/io/resource_loader.cpp:218.
I/godot ( 3224): SCRIPT ERROR: GDScript::load_byte_code: Parse Error: Can't preload resource at path: res://objects/senpai.scn
I/godot ( 3224): At: res://scripts/hero.gdc:251.
I/godot ( 3224): ERROR: load_byte_code: Method/Funct
It's strange that this code works:
var shot = preload("res://objects/spit.scn").instance()
I get the error right when starting the game. I did not click anything and the game didn't load yet.
How can I fix it? This time I installed the newest export templates...