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

Finding Z of a BodyGyro?

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

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])

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