Sway does not move correctly

Hey guys ive been trying to get my viewmodel to sway correctly buy it doesnt work.
This is what im trying to achieve:

I’m putting a place down below so you guys can see for yourselves. The problem is the spring is too stiff. No matter what i try i cant get the part to oscillate back and forth. Does anybody know how to fix this?

sway place.rbxl (19.3 KB)

So in the place i have a part that is supposed to act like the viewmodel. Test it out to see what you guys think.

Are you referring to the viewmodel moving up and down whilst the player is moving?

Yes, that is exactly what i mean

This is a separate thing. You can use springs for this if you want, but it isn’t required.

You need to set up a function that returns a cframe offset that you can apply to your view model.

The best way to do this is with a sine wave and tick().

function getBobbing(xMultiplier, yMultiplier, Modifier)
    local bobTick = tick()
    local offsetX = math.sin(bobTick * xMultiplier) * Modifier
    local offsetY = math.abs(math.sin(bobTick * yMultiplier) * Modifier
    return CFrame.new(offsetX, offsetY, 0)
end

getBobbing(5, 7, 0.5)

This will need some modification to get it to work in the way you want, but the code I provided will work for a basic bobbing system.