How do i use cframe.lookat only using y postion

I want to rotate the part to look at an other part but only using the y
component.

Just use LookAt , then on the X and Z put the position of the part looking at the other part and on the Y put the position of the part to look at.

Try this script, which should only rotate the Y axis.

local Part = game.Workspace.Part -- part you want to be looking
local OtherPart = game.Workspace.OtherPart -- part you want to be looked at

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

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