Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
0

How would I get the rotation of the camera?

Asked by 9 years ago

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

Log in to vote
1
Answered by
Goulstem 8144 Badge of Merit Moderation Voter Administrator Community Moderator
9 years ago

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

0
Oh, I knew about the CFrame, but how do I get the other digits from it? Vlatkovski 320 — 9y
0
Have you ever tried printing out a CFrame value? You'll get 12 digets instead of 3. Goulstem 8144 — 9y
Ad

Answer this question