So i’m trying to make a character look at a part via CFrame.lookAt and PivotTo(), but i want it to only change the X and Z axis
But i just cannot figure out how to, i tried multiplying the cframe with Cframe.new(1, 0, 1) but that just doesn’t work. I also just tried adding a part and setting the cframe and locking it to one plane, but that didn’t work either
local targetPosition = targetPart.Position
local characterPosition = character:GetPivot().Position
local lookAtPosition = Vector3.new(targetPosition.X, characterPosition.Y, targetPosition.Z)
local newCFrame = CFrame.lookAt(characterPosition, lookAtPosition)
character:PivotTo(newCFrame)