Hello! So for the past few months I’ve been developing a game, and one part of it was a custom camera system. If you use regular Roblox’s capped 60 fps, it works fine. However, since there’s a high chance that Roblox will eventually add a higher FPS support, I decided to download an FPS unlocker. However, when I played my game with the FPS unlocker, this happened:
For reference, this is what it’s supposed to look like:
I assume it’s caused by how the tweening system of the camera works, and I tried solving it with math, but it really never ended up working. Here’s the camera code:
task.wait()
local camera = workspace.CurrentCamera
camera.CameraType = Enum.CameraType.Scriptable
local plr = game.Players.LocalPlayer
local char = plr.Character
local mouse = plr:GetMouse()
local screenshake = false
local screenshakepower = 0
local campart = game.Workspace:WaitForChild("CamPart")
local maxTilt = 5
local ts = game:GetService("TweenService")
local angle = "front"
local previousposition = Vector3.new(0,0,0)
local cando = true
local ismonster1 = false
game:GetService("RunService").Heartbeat:Connect(function()
local offset = Vector3.new(0,0,0)
local humroot = char:FindFirstChild("HumanoidRootPart")
if cando == true then
local asd = 0
camera.FieldOfView = 72.5
if angle == "right" then
offset = Vector3.new(0,1.5,10)
end
if angle == "left" then
offset = Vector3.new(0,1.5,-10)
end
if angle == "front" then
offset = Vector3.new(-10,1.5,0)
end
if angle == "top" then
offset = Vector3.new(-2,15,0)
end
if angle == "back" then
offset = Vector3.new(10,1.5,0)
end
if angle == "angledfront" then
offset = Vector3.new(-10,7,0)
end
if angle == "birds" then
offset = Vector3.new(-2,25,0)
end
local crouchscript = game.Players.LocalPlayer.Character:FindFirstChild("CrouchScript")
if crouchscript ~= nil then
if crouchscript.Crouch.Value == true then
offset = offset - Vector3.new(0,2,0)
end
end
end
local valuee = 0.07
if screenshake == true then
print("changed")
offset = offset + Vector3.new(math.random(screenshakepower * -1, screenshakepower),math.random(screenshakepower * -1, screenshakepower),math.random(screenshakepower * -1, screenshakepower))
end
if cando == true then
if humroot ~= nil then
if ismonster1 == false then
local twen = ts:Create(campart, TweenInfo.new(valuee,Enum.EasingStyle.Sine,Enum.EasingDirection.InOut), {CFrame = CFrame.new((humroot.Position + offset), humroot.Position)})
camera.FieldOfView = 70
twen:Play()
else
local twen = ts:Create(campart, TweenInfo.new(valuee,Enum.EasingStyle.Sine,Enum.EasingDirection.InOut), {CFrame = CFrame.new((humroot.Position + (offset + Vector3.new(0,1.5,0))), game.Workspace.CameraLookAt.Position)})
camera.FieldOfView = 105
twen:Play()
end
end
else
if screenshake == true then
local twen = ts:Create(campart, TweenInfo.new(valuee,Enum.EasingStyle.Sine,Enum.EasingDirection.InOut), {Position = previousposition + offset})
twen:Play()
end
end
camera.CFrame = campart.CFrame * CFrame.Angles(
math.rad((((mouse.Y - mouse.ViewSizeY / 1.5)/mouse.ViewSizeY)) * -maxTilt),
math.rad((((mouse.X - mouse.ViewSizeX / 1.5)/mouse.ViewSizeX)) * -maxTilt),
0
)
end)
I have no idea where to start to fix this, so that’s why I’m at devfourm. Please help!