How to make this smooth

Hello, im trying to make the ads mode smoother, and yes ik that there are 99+ tutorials and topics on this, but i just didnt understand or they looked really different.

How it looks now

Now it just instantly snap to the aim offset.

What did i try?
I tried tweening and lerping.
No success.

Code:

local rotation = cam.CFrame:ToObjectSpace(lastCF)
local X,Y,Z = rotation:ToOrientation()
local alpha = wStats.SwaySens * dt
swayCFrame = swayCFrame:Lerp(angl(sin(X)*swayIntensity,sin(Y)*swayIntensity,0),alpha)
aimswayCF = aimswayCF:Lerp(angl(sin(X)*swayIntensity/4,sin(Y)*swayIntensity/4,0),alpha*2)

lastCF = cam.CFrame

local target = cam.CFrame* wStats.Offset* wStats.AimOffset* aimswayCF
vm:PivotTo(target) -- positioning

wStats is a module script in the viewmodel that has the settings of the gun. Think of things like damage, firerate, aim offset etc etc.

There’s a really good tutorial on this. the objective you’re looking for is going to be number 5, hope this helps

I will look into it, until then im hoping on other replies that go with my script instead of another dudes script

i decided to not be a dumb ahh and lerped the thing.

local target = cam.CFrame* wStats.Offset* wStats.AimOffset
vm:PivotTo(vm:GetPivot():Lerp(target, aimPha))

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.