- Edited
Hey All!
My character has a magic notebook that appears to give him hints. I've created custom signals from my dialog script to tell the notebook sprite when to appear. After the notebook's "appear" animation, I want it to play it's "float" (idle) animation, so I used the animated sprite's animation_finished signal to trigger the "float" animation. That's all good and well! But when the dialog ends, I want the notebook to play the "disappear" animation. My problem is the "animation_finished" signal keeps firing, so the "float" animation keeps playing. I thought disconnecting the signal before running the "disappear" animation would work, but nothing happens. I'd appreciate any thoughts on how I might fix this OR how I might do this better!
Thanks y'all!
Here's the code in question:
func _on_DialogBox_dialog_start():
$Notebook.visible = true
$Notebook.play("appear")
func _on_DialogBox_dialog_end():
$Notebook.disconnect("animation_finished", self, "_on_Notebook_animation_finished")
$Notebook.play("disappear")
func _on_Notebook_animation_finished():
$Notebook.play("float")