I’m making a first-person body camera, the last step I have to completing it is moving the players head a bit forward, however, this makes the camera jittery whilst turning.
script:
local runService = game:GetService("RunService")
local players = game.Players
local player = players.LocalPlayer
local character = player.Character or player.CharacterAdded:Wait()
local hum : Humanoid = character:WaitForChild("Humanoid")
local head = character:WaitForChild("Head")
local camera = workspace.CurrentCamera
local cameraOffset = Vector3.new(0,0,-1)
hum.CameraOffset = cameraOffset
local function setTrans(transparency)
for i,v in pairs(character:GetChildren()) do
if (v:IsA("BasePart")) and (v.Name ~= "Head") then
v.LocalTransparencyModifier = transparency;
elseif (v:IsA("Accessory")) and (v:FindFirstChild("Handle")) then
if v.Handle:FindFirstChild("AccessoryWeld").Part1 == head then
else
v:FindFirstChild("Handle").LocalTransparencyModifier = transparency;
end
end
end
end
game:GetService("RunService").RenderStepped:Connect(function()
local isfirstperson = (head.CFrame.Position - camera.CFrame.Position).Magnitude < 2
if isfirstperson then
setTrans(0)
end
end)
this is the only script in the game so nothing else is affecting it.
If you could help it would be greatly appreciated.