Attempting to do a "sway" effect

Hello, i’m trying to do a bounce effect when you move your mouse with an object

Just like this:

I have a spring module by Quenty that should help, but i can’t get the correct mouse delta.

Input.Delta only works when the camera is locked or moved by holding right click.

And i’m also not sure how to do it.


Delta describes the displacement between two vectors. You could tap into a RunService event and get the displacement of the mouse between two frames which would be your delta.

So is it like this?

local rs = game:GetService("RunService")

local uis = game:GetService("UserInputService")

local pos = uis:GetMouseLocation()

local lastPosition = pos

local delta = nil


local newPosition = uis:GetMouseLocation()

delta = newPosition - lastPosition

lastPosition = newPosition


Okay, if that’s somehow right, How would i make it bounce with a Spring module?

Yep an additional idea is, instead of using mouse delta to use the delta in the change of position of the tower.

That is also a delta you could use.

For a bounce with spring module you can convert it to terms of angular velocity and displacement like here:

It’s the same concept as an fps viewmodel sway, and there’s multiple methods about it, you might like the one from fps framework 2 which is simpler.

What is the method “fps framework 2”?

The post below the post