Hello,
I’m trying to make a camera lerp, but for some reason when I move the camera moves differently than when I spawned.
When I spawned:

After I moved:

If you can tell it looks more tilted on the 1st one and on the 2nd one it’s more straight above. What my script is:
local CAMERA_OFFSET = Vector3.new(-5,40,0)
camera.CameraType = Enum.CameraType.Scriptable
camera.CFrame = CFrame.new(humanoidrootpart.Position + CAMERA_OFFSET)
local function onRenderStep()
if player.Character then
camera.CFrame = camera.CFrame:Lerp(CFrame.new(humanoidrootpart.Position + CAMERA_OFFSET,humanoidrootpart.Position),0.9)
end
end
(Also I didn't add the local scripts and events)
Thank you,
for reading
Can you show the full script I’ve filled in the missing pieces and tested myself i seemed to have no problems at all.
CodeBlock
local camera = workspace.CurrentCamera
local Players = game:GetService("Players") local Player = Players.LocalPlayer
local Character = Player.Character or Player.CharacterAdded:Wait()
local humanoidrootpart = Character.HumanoidRootPart
local CAMERA_OFFSET = Vector3.new(-5,40,0)
camera.CameraType = Enum.CameraType.Scriptable
camera.CFrame = CFrame.new(humanoidrootpart.Position + CAMERA_OFFSET,humanoidrootpart.Position)
local function onRenderStep()
if Player.Character then
camera.CFrame = camera.CFrame:Lerp(CFrame.new(humanoidrootpart.Position + CAMERA_OFFSET,humanoidrootpart.Position),0.9)
end
end
local runservice = game:GetService("RunService")
runservice.RenderStepped:Connect(function()
onRenderStep()
end)
It’s basically the same thing except I used bind to render step and context action service. Overall it’s the same though.