CFrame.lookat() not doing anything

I’m trying to make a part face the player only on the Y axis, came up with this code but the part just remained stationary is not doing anything. There are no errors either.

Here’s my code:

local Character = LocalPlayer.Character or LocalPlayer.CharacterAdded:Wait()
local LocalArrow = workspace.Arrow

RunService.RenderStepped:Connect(function()
	LocalArrow:PivotTo(CFrame.lookAt(LocalArrow.Position, Vector3.new(LocalArrow.Position.X, Character:GetPivot().Position.Y, LocalArrow.Position.Z)))
	LocalArrow.CFrame = CFrame.lookAt(LocalArrow.Position, Vector3.new(LocalArrow.Position.X, Character:GetPivot().Position.Y, LocalArrow.Position.Z))
end)

Any help is appreciated

local targetPos = Vector3.new(target.HumanoidRootPart.Position.X, hrp.Position.Y, target.HumanoidRootPart.Position.Z)

local targetCFrame = CFrame.lookAt(hrp.Position, targetPos)
hrp.CFrame = targetCFrame

try and make some edits to this script. it may help you achieve your end goal

Try removing the LocalArrow.CFrame line. :PivotTo() is basically identical to setting the CFrame of a model’s primary part, and if this is a model, models do not have a CFrame property.