Hey,
I have set up a basic animation, where the animation will automatically move the camera and load a new scene once the animation has finished, but when the player goes back into the same scene then the animation plays again. Where as when the player goes back into the same scene, then I don't want the animation to play at all.
extends Camera2D
# Get a reference to the AnimationPlayer, which is a child of the camera.
onready var anim = $AnimationPlayer
func _ready( ):
# Connects the AnimationPlayer with the signal "animation_finished" to the camera ('self' here)
anim.connect("animation_finished", self, "_on_AnimationPlayer_animation_finished")
func _on_AnimationPlayer_animation_finished(animation):
# Check the name of the animation, which is finished.
# In your case the camera moving animation..
if animation == "camera_auto_move":
get_tree().change_scene("scenes/missions/prologue/prologue-hallway.tscn")