How do I make a part not rotate its vertical axis

What it does: https://gyazo.com/62261e22f3c407184e71f003f2702b7f

What I want it to do: https://gyazo.com/3431e2d702046e8e62906e27f317c9d0

I’ve tried for like an hour now trying to make it so that the part’s field of view remains horizontal no matter where the mouse is positioned on the y axis. Help?

Current code:

local ourPlayer = game.Players.LocalPlayer
local mouse = ourPlayer:GetMouse()
local runService = game:GetService("RunService")
local ourPart = game.Workspace.Part
local constantPartLocation = ourPart.Position

runService.RenderStepped:Connect(function()
	ourPart.CFrame = CFrame.new(constantPartLocation, mouse.Hit.p)
end)```

You can edit the LookAt parameter of the CFrame constructor and set the Y value to the height of the part, like so:

ourPart.CFrame = CFrame.new(constantPartLocation, Vector3.new(mouse.Hit.p.X, ourPart.CFrame.p.Y, mouse.Hit.p.Z))

You can try this:

local ourPlayer = game.Players.LocalPlayer
local mouse = ourPlayer:GetMouse()
local runService = game:GetService("RunService")
local ourPart = game.Workspace.Part
local constantPartLocation = ourPart.Position

runService.RenderStepped:Connect(function()
    local dir = (mouse.Hit.p - constantPartLocation).Unit * Vector3.new(1, 0, 1)
	ourPart.CFrame = CFrame.new(constantPartLocation, constantPartLocation + dir)
end)