I have an isometric camera system for my game and ive made a script that follows the mouse a small bit to make it feel better. However my code is very wrong and doesnt follow in the direction i want it to. Whats the best way to approach this?
runService.RenderStepped:Connect(function()
if character then
if character:FindFirstChild("Head") then
local mousePos = Vector2.new(mouse.X, mouse.Y)-(camera.ViewportSize*0.5)
game:GetService("SoundService"):SetListener(Enum.ListenerType.ObjectCFrame, character.Head)
local pos = Vector3.new(character.Head.Position.X + mousePos.X/100 + ((mousePos.Y/100)), character.Head.Position.Y, character.Head.Position.Z + ((mousePos.Y/100)))
camera.CFrame = CFrame.new(Vector3.new(pos.X + zoom, pos.Y + zoom, pos.Z + zoom), pos)
end
end
end)