Camera Choppy with script

Don’t know why but the camera is really choppy, the only script that really affects the camera is this one

local RunService = game:GetService("RunService")

local plr = game.Players.LocalPlayer

local char = plr.Character or plr.CharacterAdded:Wait()

local head = char:WaitForChild("Head")
local HumRootPart = char:WaitForChild("HumanoidRootPart")

local CameraPart = nil

local function CreateCameraPart(char)

	CameraPart = Instance.new("Part")
	CameraPart.Anchored = true
	CameraPart.Size = Vector3.new(0.1, 0.1, 0.1)
	CameraPart.Transparency = 1
	CameraPart.CanCollide = false
	CameraPart.CFrame = HumRootPart.CFrame * CFrame.new(0,0,2)
	CameraPart.Parent = char

	local plrCamera = game.Workspace.CurrentCamera

	if plrCamera then
		plrCamera.CameraSubject = CameraPart
	end
end

CreateCameraPart(char)

RunService.RenderStepped:Connect(function ()

	if CameraPart then
		CameraPart.CFrame = CameraPart.CFrame:Lerp(head.CFrame, 0.2)
	end
end)
1 Like

Is it still choppy if you use a value smaller than 0.2?

2 Likes

that didn’t fix it, still bugging out for some reason it did make it happen less though

1 Like

I also put the script in a different place to see if it still happened and the issue STILL occurs

it doesnt happen consistently though?

1 Like
Summary

use 0.0?

2 Likes

If I use 0.0 then it won’t follow the player, it will stay locked to the players head

I want to have the effect like in the game dead by daylight, where the camera follows the player/ trails behind the player.


(video is a little laggy)

1 Like

If anybody can I guess just try to copy my script put it into startercharacterscripts and see if they can find a fix to the problem

also set the player type to r6

also reminder that it doesnt happen consistently, sometimes if you test it works, sometimes it doesnt

I still haven’t been able to find a fix for this, don’t what the cause is either.

If you just want an offset, you can use Humanoid.CameraOffset. If you want the smoothness (like its animated), you should use a tween, or even better, springs. spr is my personal favorite; really simple yet so powerful, and has a visualizer. The only line you’ll change is the one where u set the camera’s CFrame. With springs you probably won’t need the CamraPart thing.

1 Like

Used a different spring module but it worked out perfectly, thanks!