I am trying to make an Aim Down Sight system for my FPS gun. I am going about this by creating a part, lerping that part, then moving the AimPart to match it, therefore moving the entire model. However, when i do this, it doesn’t lerp the part:
robloxapp-20200917-1828298.wmv (2.1 MB)
Here is my code for the creation and lerping:
UIS.InputBegan:Connect(function(KeyDown)
if KeyDown.UserInputType == Enum.UserInputType.MouseButton2 then
if Aiming == false then
local AimDummy = Instance.new("Part", FakeArms)
AimDummy.Size = FakeArms[script.GunName.Value].AimPart.Size
AimDummy.Orientation = FakeArms[script.GunName.Value].AimPart.Orientation
AimDummy.Position = FakeArms[script.GunName.Value].AimPart.Position
AimDummy.Name = "AimDummy"
AimDummy.Anchored = true
AimDummy.Transparency = 0
for i = 0, 1, 0.05 do
wait()
AimDummy.CFrame:Lerp(game.Workspace.CurrentCamera.CFrame, i)
if i == 1 then
AimDummy:Destroy()
end
end
end
end
end)