How to convert CFrame lookat to AlignOrientation?

Hello! I’m not good with CFrames, and I’ve been trying to figure out this issue for far too long now. The following code is SUPPOSED to transfer the cframe lookat into the align orientations primary axis

local T = game.Workspace.Target
local C = game.Workspace.Rig

while wait() do
	
	local OrientationCFrame = CFrame.lookAt(C.Torso.Position,T.Torso.Position)

	local X,Y,Z = OrientationCFrame:ToOrientation()
	
	print(X,Y,Z)
	
	script.Parent.Torso.AlignOrientation.PrimaryAxis = Vector3.new(X,Y,Z)
end

But to put it in simple terms, it won’t work. I’ve tried multiple combinations but to no avail. If anyone could help me it would be greatly appreciated!

Align orientation already has a CFrame property in one attachment mode.

In 2 attachment modes you can modify the attachments .WorldCFrame property.

Otherwise if you are sticking with primary and secondary axis it should correspond to the CFrames Upvector and rightvector respectively based on the similar to an attachment in studio ill have to recheck.