Hey There! I hope you checked this post without looking at the bad name of the post, as I couldn’t figure out a way to name this, but I currently have been working on my First Person weapons, and I finally made first person sway, as the GIF is here.
However, due to this, I currently can’t figure out how I’d do Aim Down Sights with this, as I am doing the sway by lerping the CFrame of the Arm’s position.
--//First Person Weapon Stuffs\\--
RunService.RenderStepped:connect(function()
local position = CFrame.new(Camera.CFrame.p)
local startRotation = arms.Head.CFrame - arms.Head.CFrame.p
local goalRotation = Camera.CFrame - Camera.CFrame.p
local speed = 0.8 -- Between 0 and 1, lower causes more movement "lag"
arms.Head.CFrame = position * startRotation:lerp(goalRotation, speed)
end)
However, my issue is how would i go around doing it, as this was the old script I had.
local function aimDownSights(aiming)
local start = arms.Head.CFrame --I think this could work?
local goal = aiming and arms.Head.CFrame * offset or CFrame.new()
aimCount = aimCount + 1
local current = aimCount
for t = 0, 101, 10 do
if (current ~= aimCount) then break end
game:GetService("RunService").RenderStepped:Wait()
arms.Head.CFrame = start:Lerp(goal, t/100)
end
end
Some things I tried before was this, however trying to do this gets me into a situation where i have 2 renderstepped running for the Arms CFrame, which I don’t think would make this work (correct me in the comments below), as what could I do here?
If you could help, that’d be appreciated.