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

Finding Z of a BodyGyro?

Asked by
Hibobb 40
10 years ago

How would you find the Z angle value of a bodygyro's cframe? I've tried doing:

bodygyro = workspace.Part.BodyGyro
z = bodygyro.cframe.z
print(z)

but with no success. How could this be done?

1 answer

Log in to vote
0
Answered by
MrNicNac 855 Moderation Voter
10 years ago

cframe:toEulerAnglesXYZ() returns three separate numbers with the matrix values combined into the three euler angles.

local bodygyro = workspace.Part.BodyGyro
local Angles = {bodygyro.cframe:toEulerAnglesXYZ()}; -- 1=X, 2=Y, 3=Z
print(Angles[3])

Ad

Answer this question