Title.
But more specifically:
If i align a CFrames UpVector to a Normal, and try to get the LookVector, it acts as if it didn’t even rotate. (or i’m missing something)
function UpVectorToNormal(CF, Normal)
return CFrame.fromMatrix(Vector3.new(0,0,0), CF.lookVector:Cross(Normal), Normal, -CF.lookVector)
end
Here is the code.
If you apply the returned CFrame to a part and then get the LookVector, it works correctly.
But that’s a roundabout method.
It’s because of the -CF.lookVector in the UpVectorToNormal function. Simply leaving it out fixes the problem, what it should be and what it’s automatically calculated as is
Giving anything other than that can cause problems, such as certain values in the CFrame being zeroed because it can’t mathematically exist with the other values, or the normals being inverted.
(and also .lookVector is deprecated, use .LookVector)