Attention | Topic was automatically imported from the old Question2Answer platform. | |
Asked By | l.riehl |
I’ve implemented a level transition handler that takes an export var PackedScene in the editor and calls a singleton to initiate a level transition:
LevelTrigger.gd
extends Area2D
export var next_scene : PackedScene
func _on_LevelTrigger_body_entered(body):
SceneChanger.change_scene(next_scene)
SceneChanger.gd
extends CanvasLayer
onready var transitionPlayer = $AnimationPlayer
func change_scene(next_scene : PackedScene):
transitionPlayer.play("TransitionOut")
yield(transitionPlayer, "animation_finished")
assert(get_tree().change_scene_to( next_scene) == OK)
transitionPlayer.play("TransitionIn")
yield(transitionPlayer, "animation_finished")
(...)
Then, in the editor, I’ve assigned it the scene I wish to load, in this case a World.tscn. When testing locally on Mac, both in the editor and in an exported .dmg, entering the trigger zone initiates the level transition with the animation, and then loads the next area. All working as intended.
However, I’ve exported a windows .zip for a friend to be able to test on Windows (with a .exe and a .pkg), and she showed me that entering the transition area triggers the animation, but the load fails and she remains in the same scene. I don’t have access to a PC right now and can’t test for myself.
I have a suspicion that this probably has to do with the way I’ve exported my project. I haven’t touched any settings, leaving everything as default and ensuring that Resources > Export Mode > Export all resources in the project is enabled. That said, is it possible that this method of changing scenes isn’t working in Windows do to another reason? Naming conventions, file locations, etc?
Thanks!