Animation not found: fade_in error?

:information_source: Attention Topic was automatically imported from the old Question2Answer platform.
:bust_in_silhouette: Asked By AlMoeSharpton86

I have a Color React parent node that a animationplayer inherits from with an attached signal. I can’t seem to get the animation to play, even though I have made sure the Fade-in animation is there and attached.

Please see linked image - https://ibb.co/25pm49F

So the anim exists, but Godot can’t seem to find it? :slight_smile:

Is this a Godot C# bug or I’m I missing something? I have also tried, with the two words’s first letters capitalized too.

My C# Code

   var FadeIn = new FadeIn();
        FadeIn.Show();
        var AnimationPlayer = new AnimationPlayer();
        AnimationPlayer.Play("fade_in");

My full Error

E 0:00:02:0917   Animation not found: fade_in
  <C Source>     scene/animation/animation_player.cpp:1142 @ play()
  <Stack Trace>  :0 @ void Godot.NativeCalls.godot_icall_4_115(IntPtr , IntPtr , System.String , Single , Single , Boolean )()
                 AnimationPlayer.cs:329 @ void Godot.AnimationPlayer.Play(System.String , Single , Single , Boolean )()
                 MainMenuScreen.cs:16 @ void MainMenuScreen._Ready()()

Thank you! :slight_smile:

:bust_in_silhouette: Reply From: kidscancode

That code above creates a new AnimationPlayer object. That new AnimationPlayer will not have any animations. According to your screenshot, the FadeIn node where the script is running already has an AnimationPlayer as a child, so you can just call play on it:

GetNode("AnimationPlayer").Play("fade_in");

Silly me! Thank you! Would you how know how to change the var FadeIn variable to match the one in the Inspector? As it turns it into a Node variable type?

AlMoeSharpton86 | 2019-06-10 02:25

I got it. thanks again!

AlMoeSharpton86 | 2019-06-10 02:40