#smooth camera system makes character look like they're vibrating

1 messages · Page 1 of 1 (latest)

rugged bane
#

made a script where a part will lerp to 2 studs in front of the character's humanoidrootpart's CFrame every time runservice heartbeat is fired (at a slow speed). camera's camerasubject is set to be the part. as title says, it makes the character look like they're vibrating when moving at a constant speed. my guess is that the part is lerping to the offset each time the character moves which causes that little camera movement and therefore the vibration effect, but i don't know how to fix.

local rs = game:GetService("ReplicatedStorage")
local runs = game:GetService("RunService")

local plr = game:GetService("Players").LocalPlayer
local focus = rs.focus:Clone()

focus.Parent = plr.Character
focus.Anchored = true
focus.Massless = true
focus.CanCollide = false
focus.CFrame = plr.Character.HumanoidRootPart.CFrame

local cam = workspace.CurrentCamera
cam.CameraSubject = focus

runs.Heartbeat:Connect(function(dt)
    local targetcframe = plr.Character.HumanoidRootPart.CFrame * CFrame.new(0,0,-2)
    focus.CFrame = focus.CFrame:Lerp(targetcframe, dt * 10)
end)
tender elbow
#

why don't u just weld the part to the torso

rugged bane
#

what does that achieve

#

???

tender elbow
#

the player isnt vibrating

#

the block is

#

because of the lerp

#

why dont u weld it

#

and set the camera cframe to the block everyframe

#

also use prerender.