Character animation for top and bottom separately (shoot while jumping/running)

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

Hello, community, and happy New Year everyone!

i am working on a 2d platformer-shooter game. The character can jump and shoot a gun.

Let’s say shooting is an animation with 5 frames. It primarily affects the top part of the body (raising the gun, shooting, a bit of knock-back, lowering the gun). And everything is relatively easy when the character is idle on the ground.

But what if he shoots while jumping or running? Let’s say running is an 8-frame animation. The player can press shoot on any of the frames. And I want the shoot animation to not interrupt the run animation and be smoothly connected to it.

Seems like the solution here is to draw 8 different shoot animations each beginning on different frames of the run animation. But that doesn’t sound right.

What would you recommend for this problem? I am sure many other game makers have faced a similar issue. What comes to my mind is some way to have separate animations for the top and the bottom of the body. So that while the bottom is running or jumping, the top is shooting. If it is the best way - how would you go about implementing that?

Thanks, Godot is amazing

:bust_in_silhouette: Reply From: AlexTheRegent

Yes, you need two separate animations for weapon and body.
Here’s one of the ways to do it https://www.youtube.com/watch?v=BQwNiU5v9as