Dynamic 2D gun recoil

Godot Version

Godot 4.5

Question

Hey! I’m new to Godot and the forums, so please be patient while I get used to everything. Coming from Gamemaker studio, there was these animation curves that were very easy to use. They had these points you could place that formed the line, and you could use multiple lines in one curve to use for multiple things. (I’m REALLY bad at explaining it, if you want to understand better there is plenty of videos about it.) I had used them to make guns have very dynamic recoil, modifying the angle and position of the gun without having to animate it by hand. I’ve tried using Curves and the Animation player to get the same effect, both of which had not so pleasing results. Is there some kind of node that can do something like this, or is it something that i’d have to code?

You can add bezier track to an animation in the animation player, switch the animation player to “curve editor” mode and edit the animation curve.

There’s also an option of using tweens.

For a more specific suggestion, perhaps post a video of an example animation you want to make.

1 Like

Thanks for replying! I’ll try the option you stated here, but as for being more specific, why not show what i had made?

This is what the animation curve looks like. The blue curve modifies the x/y knockback, while the red curve changes the angular knockback.

This is what it looks like all put together. I hope these examples give you a better idea of what i’m aiming for here.

Bezier curve tracks should be able do to what you want.