Make CFrame.lookAt() only the x axis

So I tried doing
Part.CFrame = CFrame.lookAt(Part.Position, otherPart.Position)

The code works but I only want the part to turn left and right and not include up and down.

1 Like

Make the part look at the other part at the same Y position.

Part.CFrame = CFrame.lookAt(Part.Position, Vector3.new(otherPart.Position.X, Part.Position.Y, otherPart.Position.Z))

Thx this worked! Idk why I never thought of doing this.

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.