Good day! I'm currently working on an isometric camera game, where your character turns towards your mouse. The issue is, only method I found to do this was by using TargetFiltering to make the mouse react only to certain parts. So while you're on the level of ground, everything is okay, but going to a buildings second floor, character turning becomes a huge issue like this: https://i.gyazo.com/abd34ff724dfd1ea915519893bff3fc0.mp4
I'd need the mouse to find X and Z axels relative to Y axel of characters root part. Any ideas how to do this? Here's how I made it work so far:
local player = game.Players.LocalPlayer
local character = player.Character
local gyro = nil
local mouse = player:GetMouse()
mouse.TargetFilter = game.Workspace.Environment
local runService = game:GetService('RunService')
local function onCharacterAdded(character)
local torso = character:WaitForChild('HumanoidRootPart')
gyro = Instance.new('BodyGyro', torso)
gyro.P = 500000
gyro.MaxTorque = Vector3.new(0, 500, 0)
local humanoid = character:WaitForChild('Humanoid')
humanoid:SetStateEnabled(Enum.HumanoidStateType.Jumping, true)
humanoid:SetStateEnabled(Enum.HumanoidStateType.Climbing, true)
humanoid.AutoRotate = false
end
local function isnan(x) return x ~= x end
local function onRenderStep()
if gyro then
--local mouseHit = mouse.Hit.p
local mouseHit = Vector3.new(mouse.Hit.x,character.HumanoidRootPart.Position.Y,mouse.Hit.z)
print(mouseHit)
if not (isnan(mouseHit.X) or isnan(character.HumanoidRootPart.Position.Y) or isnan(mouseHit.Z)) then
gyro.CFrame = CFrame.new(player.Character.HumanoidRootPart.Position, mouseHit)
end
end
end
while not player.Character do wait() end
onCharacterAdded(player.Character)
player.CharacterAdded:connect(onCharacterAdded)
runService:BindToRenderStep('TrackMouse', Enum.RenderPriority.Input.Value, onRenderStep)
Thanks for reading!

11 comments
That was my first attempt trying to fix this, and didn't quite do anything. Mouse still falls through characters height and finds X and Z from the physical part it hits. Or is that what you mean?
Well the Z and X coordinates are unaffected by the height of an object, however the Y is. So if you control the Y value and set it to the Player's height, it shouldn't make a difference where the mouse points.
If you still have issues though you could try pasting the code you had before in that form and I can look at it?
The mouse reacts only to basepart, so being way above the basepart makes turning your character work relative to where your mouse is on the surface of the baseplate. https://gyazo.com/d0ab0b30dfb4d16721d666c8f03d83fe
Added the whole mouse controlling code to the thread, ya can now take a look at it. And thanks!
I can't remember if this affects animations or not, it probably does, but have you tried CFrames?
You mean replacing Vector3 at line 25 with CFrame? That only returns an error "Workspace.Gybron.CharacterControls:28: bad argument #2 to 'new' (Vector3 expected, got CFrame)"
https://pastebin.com/xp39hGeC
The thing is that it rotates character to where your mouse hits a surface, so making the Y axel relative to characters torso does no change, since the mouse still takes X and Z from the part it hits below you.
Honestly not sure then, sorry I couldn't help.
No problem, many thanks anyway!