-
What do you want to achieve? Keep it simple and clear!
i want to make aim down sights for my gun -
What is the issue? Include screenshots / videos if possible!
as you can see in the video the camera should lerp to the aimpart but as soon as i equip the tool my camera gets stuck into the tool’s(PrimaryPart) and when i aim it lerps to aimpart. it should be reversed i am desperate for a solution
this is the bug
Gun:PivotTo(Camera.CFrame * aimCF )
local Aiming = false
local AimPart = Gun:WaitForChild("AimPart")
local aimCF = CFrame.new()
local offset
RunS.RenderStepped:Connect(function(deltaTime)
if Aiming then
offset = AimPart.CFrame:ToObjectSpace(Gun.PrimaryPart.CFrame)
aimCF = aimCF:Lerp(offset, 0.1)
Gun:PivotTo(Camera.CFrame * aimCF )
else
offset = CFrame.new()
aimCF = aimCF:Lerp(offset, 0.1)
Gun:PivotTo(Camera.CFrame * aimCF)
end
end)