I’ve been trying to make this smooth camera that you can rotate with the arrow keys (planning to add sensitivity), but I can’t seem to make it rotate.
The camera only rotates a tiny bit before stopping.
Code:
RunServ.Heartbeat:Connect(function()
Cam.CameraType = Enum.CameraType.Scriptable
Cam.CFrame = Cam.CFrame:Lerp(CFrame.new(script.Parent:WaitForChild("HumanoidRootPart").Position + Vector3.new(0, 5, -25), script.Parent:WaitForChild("HumanoidRootPart").Position + Cam.CFrame.LookVector), .15)
end)
UserInputServ.InputBegan:Connect(function(Input, Processed)
if not Processed then
if Input.KeyCode == Enum.KeyCode.Right then
local Rep = true
local Con = UserInputServ.InputEnded:Connect(function(Input)
if Input.KeyCode == Enum.KeyCode.Right then
Rep = false
end
end)
repeat Cam.CFrame = Cam.CFrame * CFrame.Angles(0, -math.rad(.1), 0) RunServ.RenderStepped:Wait() until not Rep
Con:Disconnect()
Rep = false
end
end
end)