Animation using separate images

:information_source: Attention Topic was automatically imported from the old Question2Answer platform.
:bust_in_silhouette: Asked By kaitodomoto
:warning: Old Version Published before Godot 3 was released.

So, I’ve been surfing the internet for about two weeks now and have yet to find an answer to this. How do you animate a character that is composed of different body parts, and change them as it animates/moves?

The character is composed of those following:

  • a body with legs and one arm
  • interchangeable arm depending on action taken (attack, shoot, etc.)

How do I make it so when the character do an action, the character animates with those interchangeable images?
The only solution that I have found so far is that I have to write my own animator in either GDScript or C++. I honestly want to leave that as a last resort though, not because I don’t want to, more on the lines, that I know it’s gonna cause some performance issues.

If you know of a way to do this, please let me know. I’ve tried using AnimatedSprite, AnimatedPlayer/Tree, and none seem to do what I want. Not even that whole cutout animation is not what I’m looking for.

:bust_in_silhouette: Reply From: jospic

Take a look here:

and here:

-j

Haha, I was just about to point the OP there but you beat me to it :slight_smile:
It’s a fantastic tutorial btw

Michael Paul | 2017-11-16 16:36

Unfortunately this isn’t what I’m looking for, it’s the same thing as the Cutout animation tutorial in the godot docs. I believe I’ll just have to create my own animator inside the source code, or I might just write it using GDScript.

I need to animate literally multiple body parts (Arms, Bodys, Heads, etc.), while this animation technique might work if you just have one whole set of the character, but I have multiple for different actions that the character may take. The animation in the end is technically considered Frame-by-Frame, but not exactly. I’m currently looking into 2D Skeletal animation using Dragon Bones, but the editor doesn’t seem to accept the animation (JSON), and then I also realize it spits out a texture atlas, and with 100+ images…that’s going to be a bit too big imo. If there are any other options, please let me know.

kaitodomoto | 2017-11-17 04:28

:bust_in_silhouette: Reply From: kaitodomoto

Turns out the answer was pretty much in front of my face. I ended up using AnimationPlayer to be able to animate the different parts correctly. Though it did take some trial and error to get it correct, it worked out better than I thought it would.

Thanks for the other answers I do appreciate it, if anyone has the same issue I had, use AnimationPlayer, it might be a little tricky to use at first, but once you get the hang of it; it’s very simple and powerful.

The answer given my @Jospic is what lead me to trying it out, and it worked out really well.

How did you swap pieces during animation?

HeroicNate | 2019-07-12 05:44