I have nearly no idea what is going on but my complete code that has anything to do with this issue is as follows.
func _ready():
get_tree().paused = true # Timer's pause_mode is process, SceneChanger's pause_mode is process
yield(SceneChanger, "scene_changed")
countdown()
func countdown():
while $Start.time_left >= 1.0:
print(str($Start.time_left))
$CanvasLayer/Time.text = str(round($Start.time_left)) # Time's pause_mode is process.
Script of SceneChanger-autoload:
signal scene_changed
func change_scene(scene_to_load_path, delay = 0):
if scene_to_load_path == "res://game/game.tscn":
$AnimationPlayer.play("fade")
yield($AnimationPlayer, "animation_finished")
assert(get_tree().change_scene(scene_to_load_path) == OK)
$Control/ColorRect.modulate.a = 0
emit_signal("scene_changed")
return
What i know is that countdown()
is never called because this scene waits until "scene_changed" was emitted but for some reason, it thinks it is never being emitted!? Maybe the problem was this from the beginning upsi xD.