Best usage for a character with multiple animations

Godot Version

4.4

Question

I have one character with multiple animations in .gltf format. I want to typecast them based on their attack.

What’s better/efficient way to go about this? I am thinking:

A) Keep all animations in the single imported animationPlayer then call the animation I need with the script.


Basically each type of enemy will have all these animations in its player but only use some of them.

or

B) Export each animation as file then create an animationPlayer for each type of enemy, then import only needed animations.

A, because B won’t do what you think it will do. If your .gltf file contains animations, they all get imported. Saving some of them only makes those animations editable in the AnimationPlayer. They will all show up.

If you want to cherry-pick animations to appear for memory reasons, you need to load it up in Blender and delete the animations you don’t want to import.

So for B, I would have a list of animations for that character as files and then Import my character .gltf (with only skeleton and mesh, no animations). I then create animationPlayer and pick and choose animation files from animation library.

Does it make any difference? for example A would be 3 characters each with all animations shown in their animationPlayer vs. B with 3 characters with fewer animations shown.

If you want to do it that way, yes it would reduce the size of the objects in memory.

1 Like

Thanks for clearing that up for me. I tried doing the B way and was wondering if it’s worth doing it. Now I know there is some advantage to it. :+1:

1 Like