#Camera Jittering

1 messages · Page 1 of 1 (latest)

sudden eagle
#

So i was trying to make Over-the-Shoulder type of camera and lerp it to feel the speed of the character, but after i added lerping camera started to jitter and i idk how to fix this. I have already tried many diff ways but nothing seems to help.
Code:
local RunService = game:GetService("RunService")

local Camera = workspace.CurrentCamera
local CameraPart = Instance.new("Part", workspace)
CameraPart.Size = Vector3.new(0.5, 0.5, 0.5)
CameraPart.Transparency = 1
CameraPart.CanCollide = false
CameraPart.Anchored = true
CameraPart.Name = "CameraPart"
Camera.CameraSubject = CameraPart
Camera.CameraType = Enum.CameraType.Custom

RunService.Heartbeat:Connect(function(dt)
Camera.CameraSubject = CameraPart
local Character = game.Players.LocalPlayer.Character
if not Character then return end
local Humanoid = Character:FindFirstChild("Humanoid")
local HumanoidRootPart = Character:FindFirstChild("HumanoidRootPart")
if not Humanoid or not HumanoidRootPart then return end

CameraPart.CFrame = CameraPart.CFrame:Lerp(CFrame.new(HumanoidRootPart.Position + Camera.CFrame.RightVector*2 + Vector3.new(0, 1.5, 0)),

10*dt)
end)

next nimbus
#

Use runservice.renderstepped

sudden eagle
next nimbus
#

Set the cameratype to scriptable not custom

#

Your fighting control for the camera

sudden eagle
#

plus i why would it work without lerping then

next nimbus