Camera and character movement for isometric camera script

I’ve been trying this isometric camera tutorial implementing the code provided with some slight changes:

local Players = game:GetService("Players")
local RunService = game:GetService("RunService")

local player = Players.LocalPlayer
local camera = workspace.CurrentCamera

local CAMERA_DEPTH = 64
local HEIGHT_OFFSET = 25

camera.FieldOfView = 40

local function updateCamera()
	local character = player.Character
	if character then
		local root = character:FindFirstChild("HumanoidRootPart")
		if root then
			local rootPosition = root.Position +, HEIGHT_OFFSET, 0)
			local cameraPosition = rootPosition +, CAMERA_DEPTH, CAMERA_DEPTH)
			camera.CFrame = CFrame.lookAt(cameraPosition, rootPosition)

RunService:BindToRenderStep("IsometricCamera", Enum.RenderPriority.Camera.Value + 1, updateCamera)

And looks like this:…

The code mentioned above fixes the camera with CFrame.lookAt “disabling” the rotation along the Y axis. Is there any possible way to add this functionality again?

Additionally, how can I make the character to always look “north” relative to the camera view? I need this in order to make the camera always point to the back of the character. My intention is that the character auto-rotates when the camera turns (using the RMB, swipe in mobile or camera thumbstick with controller) and that the direction of the movement is relative to camera view, not to world (with keyboard: WASD should be NorthEastSouthWest according to camera view).

1 Like