A while back I made a camera script very similar to shift lock but there was some stuff that bothered me that I wanted to fix. One of those things was that it depended on the last cframes it created, not the actual last cframes of the camera so I tried doing something like this:
print(cam.CFrame:ToEulerAnglesXYZ())
local CF = cam.CFrame:ToEulerAnglesXYZ()
print(tostring(CF))
local tbl = string.split(CF, " ")
for i, v in pairs(tbl) do
print(i .. ", " .. v)
end
local newTbl =
{X = tonumber(tbl[1]), Y = tonumber(tbl[2]) or 0, Z = tonumber(tbl[3]) or 0}
print(CF)
print("x = " .. newTbl.X)
print("y = " .. newTbl.Y)
print("z = " .. newTbl.Z)
if the rotation of the camera is (0.01512346137315, 8, 6) the output looks like this:
0.01512346137315 8 6
0.01512346137315
1, 0.01512346137315
0.01512346137315
x = 0.01512346137315
y = 0
z = 0
It seems to just completely forget about the y and z.
Which gives me the feeling that by creating a variable of the CFrame I am ruining it.
Also why does it return such a strange value, why not a Vector3?