3Xp01tME
(Sparsrsa)
September 3, 2024, 12:30pm
#1
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
Well you guys seemed to like the tutorial so heres a Part 2. ¯\_(ツ)_/¯ (thanks for 33 likes!!!)
If you just came, you’ll have to first see the original post to continue else it might get confusing for you, check it out here.
Also this tutorial is a bit long might take you a day or two to complete this. (also sorry if it’s a bit complex and confusing for some people, tried explain it as much as I can)
Objectives:
Recoil, Muzzle flash and sounds
Bobble & Swaying
Hit detection
Bullet replicat…
3Xp01tME
(Sparsrsa)
September 3, 2024, 1:10pm
#3
I will look into it, until then im hoping on other replies that go with my script instead of another dudes script
3Xp01tME
(Sparsrsa)
September 3, 2024, 1:24pm
#4
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))
system
(system)
Closed
September 17, 2024, 1:24pm
#5
This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.