Camera messing up with CFrame.FromMatrix

I have realized that using CFrame.FromMatrix with the camera is kind of hard because the screen warps for seemingly no reason


The magnitude for both vectors is 1

Are you only providing two vectors to CFrame.fromMatrix() (The position + 2 additional vectors)?
This appears to be alright according to the documentation for CFrame.fromMatrix, however I’m guessing you’re running into some weird effects because vX and vY are not perpendicular vectors.

Aren’t all vectors perpendicular always?

Well no, not in the general sense of what a vector is, but yes in the sense you want them to be when dealing directly with creating a CFrame from two or three vectors. Try just printing out the units of the two vectors (non-positional argument) to check if they are perpendicular.

local cframe = CFrame.fromMatrix(pos, vX, vY)
--like if you have some line like this...
print(vX.unit)
print(vY.unit)

Well i tried this but since the lookvector should max out at 1 it’s not very effective ://

What do you mean? What values are you getting when printing out those vectors?

edit: ahh wait, are they already unit vectors? Lol, well then the code I gave was really just redundant. Might as well just print the values of vX and vY then

1 Like