func _on_outro_timer_timeout() -> void:
if Globals.rested_2_completed:
$"../outro_timer".start()
fade_effect_animation.play("fade_to_black")
get_tree().change_scene_to_file("res://Scene/outro.tscn")
once the bool is true, timer starts for 10 seconds and then it move to next scene, this works fine, but I want fade animation to work, and it doesn’t. why is that? i want fade animation to work while timer is working.
If all you are doing is fading to black there is likely no reason to use the animation player.
Switch to a tween and you can change scenes on the tween complete signal.
This way you can turf both the timer and the animation player for this simple effect.
well i have fade to_normal in ready func when scene starts, and fade_to_black when this timer is over and moving to next scene, so can it work for both? il give it a try and look online
1- Make a global script for the animations.
2- Make your animation as a CanvasLayer in a seperate scene.
3- Instantiate the scene in _ready() function in the Global script and add it to the root node (get_tree().root), do not add it to the current scene.
4- make functions in the global script for the fade in and fade out, or make a singe fuction for changing the scene which plays the fade in animation, changes the scene, plays the fade out.