Sprite weapon sway

Hey,
I’m looking for a method to recreate this kind of weapon sway:

I’m assuming its animated by code so that the weapon goes in a ∞ when moving. Would this be a LERP or something similar?

I also wanted to try a method that uses physics to tether the sprites around a point and would drag behind the central mouse movement, which I’ve only seen 3D examples of.

Any help or suggestions in either of these would be greatly appreciated.

Cheers

I achieved this in a retro FPS using the following scripts:

The weapon sprite gets all three and the player camera gets just the bobber and tilter.

You can see an example of the values I used in the project itself: GitHub - EricFreeman/DungeonGame: Unity Retro FPS

Here’s what it looks like in practice:

No animations needed, just scripts.

woah that’s perfect, exactly what i was looking for, I appreciate the help!