I've achieved making this go smoothly in the X axis, with no problems, but when you add the Y axis, it doesn't go as smooth as the X axis. Any help on making it look smoother like the X axis?
local cameraHeight = 12
local cameraZOffset = 20
local cameraXChase = 10
local cameraYChase = 20
local cameraSpeed = .25
local camera = game.Workspace.CurrentCamera
local player = game.Players.LocalPlayer
local RunService = game:GetService('RunService')
local function setupCamera()
camera.CoordinateFrame = CFrame.new(Vector3.new(0,cameraHeight,cameraZOffset), Vector3.new(0,cameraHeight,0))
end
setupCamera()
player.CharacterAdded:connect(setupCamera)
local function onUpdate()
if player.Character and player.Character:FindFirstChild('Torso') then
local playerX = player.Character.Torso.Position.X
local playerY = player.Character.Torso.Position.Y
local cameraX = camera.CoordinateFrame.p.X
local cameraY = camera.CoordinateFrame.p.Y
if cameraY - cameraYChase < playerY then
camera.CoordinateFrame = camera.CoordinateFrame + Vector3.new(0, cameraSpeed, 0)
end
if cameraX - cameraXChase < playerX then
camera.CoordinateFrame = camera.CoordinateFrame + Vector3.new(cameraSpeed, 0, 0)
end
end
end
RunService:BindToRenderStep('Camera', Enum.RenderPriority.Camera.Value, onUpdate)

2 comments
The camera focuses above the player in the empty space where the character can't be seen, Even trying to modify the "local CamOffset = Vector3.new(10, 20, -20)" the Y axis to 5 it doesn't really focus on the character, it focuses on a way long upper space.
Whoops. z should be 20, not negative. Edited.