Attention | Topic was automatically imported from the old Question2Answer platform. | |
Asked By | Juan |
I have a loading scene with an animation which I want to play when the loading page appears, and then transition to the next scene. I found it is possible to transition to the next scene using the change scene timer, when it is on Auto play, but I cannot play my animated sprite, because it will get stuck and not transition. I also have a Animation play timer, which I also play on auto play.
my code is:
extends ColorRect
onready var godotSprite = $ComputerLoad
onready var tween = $Tween
onready var godotTXT = $Control/WordPig
func _ready():
tween.interpolate_property(godotTXT, ‘modulate’, Color(1,1,1,0), Color(1,1,1,1), 1, Tween.TRANS_BOUNCE, Tween.EASE_IN_OUT)
tween.start()
func _on_AnimationPlayTimer_timeout():
godotSprite.play()
func _on_ComputerLoad_animation_finished():
$ChangeSceneTimer.start()
func _on_ChangeSceneTimer_timeout():
get_tree().change_scene(“res://change_scenes/Level2.tscn”)