Sword and other melee weapon swinging

How do I create a swing animation for swords (or axes, anything of that sort) similar to that in games like Terraria? More specifically, I’d want to do animations similar to those of swords like the Terra Blade and True Excalibur

2 Likes

Welcome to GD

It depends. In visuals there is usually a spectrum between artistically drawing/animating everything by hand and „coding“ your animation.

You could draw the whole animation including the character and the weapon in the same sprite (usually greatest artistic freedom, but most work if you add multiple weapons).
You could draw seperate sprites for the sword and the character and keep them attached via events (usually best, if you want to change any visuals dynamically).
You could draw a single sword sprite and „animate“ it via ingame events like rotation ect (it seems like that‘s how it is done in terraria)

It would be good if you have started anything, to see what you have got. Then you can get feedback here.

2 Likes

Im by no means a stranger to GDevelop, I’ve been using it for 5 years soon (this is just a new account i made while not home)

But that doesn’t matter. I don’t have anything started, as I was wondering how I could go about doing it. I’m not sure of what methods there are aside from drawing animations for it, but that seems tedious. i was asking this with the intention of someone maybe having done anything similar, to use as a reference.

Just made a simple example cause I was wondering as well after seeing your post. Nothing perfect

Maybe create an attack effect each time your character attacks and use this as the collider?

With my example you just need to put the weapon into a group and change the weapon and the attack effects.

Of course weapons such as Terra Blade will require much more work. Creating animations for each attack seems much easier to me (For the more complex weapons)

Version 2

2 Likes

Here you have a terraria style animation of “True Excalibur” without the need to animate anything.

Note:

  • I just quickly made this and did not account for player facing direction
  • The center was set to the pommel of the sword, to reflect the correct rotation. Terraria seems to include the arm of the character in the sword sprite and put the point of rotation on the characters shoulder.
1 Like