Rotation not working

Good day, so I have a problem changing the direction of a MeshPart.
It works for the X axis, but it does not for the Y (the one I really want to work).

	local PartCF = p.CFrame
	local Character = Player.Character
	local RootPart = Character:FindFirstChild("HumanoidRootPart")
	local HitDirection = (p.CFrame.p-RootPart.Position).Unit
	local AngleCF = CFrame.new(p.CFrame.p) * CFrame.Angles(90,math.rad(HitDirection.Y*90),0)
	
	local AngledPartCF = PartCF:ToObjectSpace(AngleCF)
	local AngledPartAngle = AngledPartCF - AngledPartCF.p
	local EndCF = PartCF * AngledPartAngle * (PartCF-PartCF.p)
	p.CFrame = EndCF