Scripting HelpersARCHIVE
A little piece of Roblox history. Preserved for everyone, one question at a time.Read about the archive →
✓ ANSWER ACCEPTED

How would I get the rotation of the camera?

How would I get the rotation of the camera?

Things I tried:

camera:GetRoll() --return 1 value..

Other thing I tried:

local X = math.rad(camera.Rotation.X)
local Y = math.rad(camera.Rotation.Y)
local Z = math.rad(camera.Rotation.Z)
--rotation is not a valid member...

1 answer

✓ Accepted answer

There is no rotation aspect of the camera, but you can get the CoordinateFrame of the camera, which will return the 12 diget CFrame code.

local cam = game.Workspace.CurrentCamera

local rotateCode = cam.CoordinateFrame

2 comments

0

Oh, I knew about the CFrame, but how do I get the other digits from it?

0

Have you ever tried printing out a CFrame value? You'll get 12 digets instead of 3.

This discussion is preserved as it was. New answers, comments, and votes are closed.