#character doesnt follow mouse in isometric camera mode

1 messages · Page 1 of 1 (latest)

harsh oasis
#

I have tried multiple methods from mouse.hit , to raycasting from the mouse, while im in normal camera view, it works, but in isometric, everything just breaks down

local BasePlate = workspace:WaitForChild("BasePlate")

local raycastParams = RaycastParams.new()
raycastParams.FilterDescendantsInstances = {BasePlate}
raycastParams.FilterType = Enum.RaycastFilterType.Include
local player = game.Players.LocalPlayer
local mouse = player:GetMouse()
local function updateCamera()
    local character = player.Character
    if character then
        local root = character:FindFirstChild("HumanoidRootPart")
        local unitRay = workspace.CurrentCamera:ScreenPointToRay(mouse.X, mouse.Y)
        local result = workspace:Raycast(unitRay.Origin, unitRay.Direction * 500, raycastParams)
    
        if result then
            local target = result.Position
            local y = root.Position.Y
            character:PivotTo(CFrame.lookAt(root.Position, Vector3.new(target.X, y, target.Z)))
        end

    end
end

game:GetService("RunService").RenderStepped:Connect(updateCamera)

i have a custom rig that is made from just 1 part and a humanoid root part , i have disabled the humanoid auto rotate and it still doesnt work