How would I make a ‘sway effect’ for a tower defence game?

I want to recreate this effect from tower defence simulator to make my towers bounce / sway.

I have got the delta, but i do not have any clue on how I would make it move in that way.

I found this post Attempting to do a “sway” effect however, it is very complicated for my tiny brain. I am very good at other things, just not so good with springs. I have tried many ways, but they don’t work. I am using Quenty’s spring module

This is my 3rd time posting this as all of the others just get discontinued and ghosted.

1 Like

I think it’s a mix of bezier curves technique (in time space) to create the overshooting effect.
And the movement of the bottom is based on “velocity physics”. Just simply add the factor of “friction” with air.

By the bezier curves what I meant is that the progress is encoded in the estimated time axis.
And you can “exploit” the fact that you can create your own bezier curves space like this.

For the top moving like it’s a little bit delayed, you can add a threshold for where the unit will start to tilt it’s back towards the top point and then the top point moves back to the bottom point with bezier curves effect when the mouse stops moving.

Imagine as if the “Estimated time” value was like “alpha” for lerp function. That would be pretty close.

i really do not understand this, also someone did this using Quenty’s spring module. I just need help understanding it

It’s literally the same, but my version is not really a spring, but emulates it.

I still dont understand it sorry