+1 vote

Hey,

I am currently using godot version 3.1 and I am wonder how to get my dialogue cutscene to start after the animation as finished player. BTW I followed the following tutorial for the dialogue:

https://www.youtube.com/watch?v=eXZIgaFFPDk

My code is:

extends Sprite

# 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():
    if anim == "prison-guard":
        get_tree().change_scene("res://scenes/interface/gui/DialogueBox.tscn")

Any help appreciated and thanks in advance

in Engine by (32 points)
edited by

Please log in or register to answer this question.

Welcome to Godot Engine Q&A, where you can ask questions and receive answers from other members of the community.

Please make sure to read How to use this Q&A? before posting your first questions.
Social login is currently unavailable. If you've previously logged in with a Facebook or GitHub account, use the I forgot my password link in the login box to set a password for your account. If you still can't access your account, send an email to webmaster@godotengine.org with your username.