I have an isometric camera code shown below:
local function updateCamera()
local character = player.Character
if character then
camera.CFrame = character.Head.CFrame
local root = character:FindFirstChild("HumanoidRootPart")
if root then
local CAMERA_DEPTH = 64
local HEIGHT_OFFSET = 0
camera.FieldOfView = 28
rootPos = root.Position
local rootPosition = rootPos + Vector3.new(0, HEIGHT_OFFSET, 0)
local cameraPosition = rootPosition + Vector3.new(0, 64, CAMERA_DEPTH)
camera.CFrame = CFrame.lookAt(cameraPosition, rootPosition)
end
end
end
I run this at the beginning of my program and it works fine. The problem arises later on. I modify the camera cFrame a couple of times throughout the program as shown below:
camera.CFrame = workspace.Part.CFrame
After this modification, I called the update camera method again. However, the players' movement is off. For instance, when I press W, the player moves southeast. Any reason this is happening?
