Character Facing Mouse not working when camera is isometric

I am trying to get the character to face where the mouse is pointing. The issue is that the Camera is Isometric and it won’t turn past a certain point. I’ve tried increasing the FOV but it still doesn’t work.

Code:

local Player = game.Players.LocalPlayer
local Character = Player.Character or Player.CharacterAdded:Wait()
local Root = Character:WaitForChild('HumanoidRootPart')
local Mouse = Player:GetMouse()
local RunService = game:GetService("RunService")

RunService.RenderStepped:Connect(function()
	local RootPos, MousePos = Root.Position, Mouse.Hit.Position
	Root.CFrame = CFrame.new(RootPos, Vector3.new(MousePos.X, RootPos.Y, MousePos.Z))
end)

3 Likes

I was just having the same problem and after tinkering with my code for a bit I came up with the following solution.

local Player = game.Players.LocalPlayer
local Character = Player.Character or Player.CharacterAdded:Wait()
local Root = Character:WaitForChild('HumanoidRootPart')
local Mouse = Player:GetMouse()
local RunService = game:GetService("RunService")

RunService.RenderStepped:Connect(function()
	local RootPos, MousePos = Root.Position, Mouse.Hit.Position
	Root.CFrame = CFrame.new(RootPos, MousePos * Vector3.new(1,0,1) + Vector3.yAxis * RootPos.Y)
end)
1 Like