This site is currently in read-only mode during migration to a new platform.
You cannot post questions, answers or comments, as they would be lost during the migration otherwise.
0 votes

Okay, so I'm trying to make a main menu in GD and I ran in to a problem.

extends ColorRect

signal fade_finished

func fade_in():

func onAnimationPlayeranimationfinished(animname):
________________________code end_______________________________

In the code I wrote to emit signal once animation is ended, and it doesn't emit it. :/ I've been stuck here for a while now.

in Engine by (16 points)

2 Answers

0 votes

Did you connect onAnimationPlayeranimationfinished to the player's animation_finished?

$AnimationPlayer.connect("animation_finished", self, "onAnimationPlayeranimationfinished")
by (190 points)

This code seems to not work, I tried and it doesn't for me. I found a bug which is corrected since 2018 in github, but it's not corrected correctly I think.

The best option would be to create a function that emits a signal, I will try it.

+1 vote

You can also write a function in the script of the AnimationPlayer that will emit a signal, and call it in the animation by adding a function call keyframe. Or just call the function of the receiver node directly.

by (141 points)
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 Frequently asked questions and 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 [email protected] with your username.