0 votes

I need that in a frame an action of a different scene can make, so I know that you can call a method from animation player, but I need that this method return true when the animation player call it, if not it return false, how can I do that?
I am calling the method In an instance of a different scene , so when the frame of animation player call the method, this different scene with the instance can make an action

in Engine by (131 points)

2 Answers

0 votes

If you bind parameters to the function, you can then specify what will be those variables from the animation player, you can simply have a variable at the end which is defaulted to false and when the animation player calls it just let it pass true with it

 func WantedFunction(var1, var2, var3, isFromAnimationPlayer = false)
by (1,181 points)

but if I do:

instance.WantedFunction() == false:
emit_signal("signal")

it´s always returning false, so the signal isn´t emmited when it reach the frame.

or how I can do in WantedFunction to change the false to true when the animation player frame reach?? sorry I dont know how to do it

0 votes
  • You can make a 'Call Method Track' in the Animationplayer.
  • Create a keyframe on that same track where you want it to call to a
    function in the same scene.
  • Have that (same scene) function call another scene's function.
by (304 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 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.