Creating a new Animation overwrites previous Animation using AnimationPlayer

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

I am new to Godot and I am trying to figure out how to use the AnimationPlayer to create animations. I have created an AnimatedSprite node where I stored all my walk animations of my character. So I have walk_left and walk_up for example.

Now I have selected AnimationPlayer, created a new Animation called “walk_left”, chose the 0 position of my timeline and then have clicked on my AnimatedSprite, chose the animation stored there called “walk_left” and clicked at the “Frame” option on the add key frame. I then incremented in the AnimationPlayer to position 1 and did the same again until I have all animated pictures in the timeline.

When I now hit start in the AnimationPlayer the animation runs perfectly fine.

But when I now try to create a new animation called “walk_up” in the AnimationPlayer and select the next Animation in my AnimatedSprite called “walk_up” and apply the same procedure, the second animation overwrites my first one…

I am clueless as to why this happens but it must be something trivial and since I have just started with Godot it is probably an easy fix I hope :slight_smile:

Anyways, hopefully someone has a solution here.

I suspect that you need to create a new timeline animation within the AnimationPlayer to mirror your sprite animations, but controlled by the player and not the sprite animator.

In Godot 3.0 it should be the file with a green plus in the animation editor tab. And then select the other animation timeline in the dropdown.

Brandon Cline | 2019-02-21 02:03

:bust_in_silhouette: Reply From: Eric Ellingson

Maybe I’m not understanding this correctly, but I don’t think you need AnimationPlayer in this case.

If you have the different animations set up with the AnimatedSprite, you can just set which animation you want using that node.

if Input.is_action_pressed('walk_left'):
    $AnimatedSprite.animation = 'walk_left'
    $AnimatedSprite.playing = true
elif Input.is_action_pressed('walk_up'):
    $AnimatedSprite.animation = 'walk_up'
    $AnimatedSprite.playing = true
# etc...

Hi Eric, thanks for your answer. The reason why I am using AnimationPlayer is because I am using a Framework which uses the AnimationPlayer in a certain way and I am not knowledgeable enough of the code implementation that I would want to change big parts of it :slight_smile: Thats why I was simply trying to take over whats there, but then ran into this issue as described above. But yes, I would be able to use an AnimatedSprite for this. Is there any way I can accomplish this with AnimationPlayer just to preserve whats there and work from there? The framework I am trying to work with is this one here:
GitHub - godot-escoria/escoria-demo-game: Game example for the point'n'click adventure framework Escoria, it uses AnimationPlayer and I would like to simply go from there while getting used to all the functionality it offers without me having to build it myself you see

BennieBe | 2019-02-20 18:27

I’m assuming you’ve read through this? /chapter: Animations / Creating Point and Click Games with Escoria

Eric Ellingson | 2019-02-21 05:27

Hi Eric, no must have missed that. Will check that out thanks!

BennieBe | 2019-03-06 08:56