Animation player question

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

I have an animation player, it has a walk animation, also a heal animation. I want to play the heal animation with the arms of my character, but do the walk animation of the legs of the character if I want to move. Ex: I heal but I’m stationary, but then I want to walk(Leg Animation) while still doing the heal (Arm Animation).

Do I make a different animation player?/ Can I play the two different animations at once?

I think this is doable. If the arm animation (for example, they’re a sprite animation) and the leg animation are in the same scene, then they can be animated in one single animation.

Ertain | 2020-09-10 23:24

Thank you for answering, I am using an AnimationPlayer instead of animated sprites though

Chevi | 2020-09-10 23:34

rakkarage | 2020-09-11 00:54

Hey, but both your arms and legs are on the same sprite?

p7f | 2020-09-11 16:11

They are both separate sprites, and I am using AnimationPlayer to animate them

Chevi | 2020-09-11 16:12

Ah ok, sorry, i thought the image above was shared by you. You can do it with animation tree, using blend as the answer below. While using blend, you can decide to filter some nodes, so the dont get affected by the animation. In your case, you should only leave checked the arms whlie blending, so the rest of the body continues with the other animation.

p7f | 2020-09-11 16:25

:bust_in_silhouette: Reply From: Ertain

This can be done, but you’ll probably have to use an animation tree. In this case, the blend2/blend3 nodes of the animation tree could be what you need.

Thank you! This worked! But how will I go about changing the animation in the animation node inside the blend tree? (In code)

Edit: I got it, Thanks again

Chevi | 2020-09-11 21:48

:bust_in_silhouette: Reply From: maxwellc055

Hi! Ertain is correct that you can do this with AnimationTree. (Now working in the Animation Tree Inspector) You can link the animation tree to your animation player, use a blend tree as the tree root, add your animations, add a blend 2, and connect the blend 2 to output. Now you can select “Edit Filters” on your blend 2, allowing you to only blend between the animations of certain joints/bones.
Read the AnimationTree and BlendTree docs, play around with them a bit in godot, and you’ll be a pro in no time.

Hope I could be of some assistance.