(Solved) How do i make a "swing" movement on attack?

Hey! im working on a melee weapon system.

So i have my melee weapon, and when i attack i would like to “swing” the weapon sprite (the movement effect, not the slash).

Its similar how melee weapons works on Soul Knight, because player and weapon are different objects.

Are there some behaviors that can be useful?

I’m not particularly sure of what you’re trying to achieve as I haven’t played Soul Knight. But I’m thinking perhaps orbit extension might help? Like maybe you want to have the weapon “orbit” around the player but just within arms length?

https://wiki.gdevelop.io/gdevelop5/extensions/orbiting-objects/

Also this other post might help as it’s also about making an object move around another object.

1 Like

Yes, exactly its like an orbit animation.

I could make it with Tween behavior

tween weapon object -50
wait 0.2 seconds
tween weapon object +140
wait 0.25 seconds

first rotate weapon up, it simulate a charge, and then the hit.

For calculate dmg i created a variable of melee_calculate inside of the second tween, so just when the weapon really attacks, the dmg calculate can be done

But i dont like the way that i did it because i rely on 2 “wait” inside of the condition, so im gonna test with orbit to see if i can avoid at least 1 “wait” and have the weapon smoothly return to position.

1 Like