I am trying to set the CFrame of a part to that of the camera. But, I only want the Y-axis of the part CFrame to be set. So far, I’ve tried messing around with the rotational matrix, angles, but nothing’s working.
align
is the part.
local x,y,z = camera.CFrame:ToOrientation()
local x2,y2,z2 = align.CFrame:ToOrientation()
align.CFrame = align.CFrame * CFrame.Angles(0, y - y2, 0)
Solved it and going to leave this here for anyone else wondering how. I have a clue about how it works and am not sure about performance.
3 Likes