I was making a plugin that would convert R6 Rigs Joints.C0 into code and when I tested it the Rotation was not Actually Returning the C0 Rotation instead It would return 0
If you’re experiencing issues with the rotation values of the joints, there are a few Solotions i can think of :)))
Ensure the joint you’re accessing has a non-zero rotation value: Double-check that the joint you’re interested in actually has a rotation applied to it. If the joint’s rotation is not set or is set to zero, you’ll naturally get a result of zero when accessing the rotation values.
Verify that you’re accessing the correct property: Make sure you’re accessing the correct property for obtaining the rotation values. In Roblox, the rotation of a JointInstance is stored in the CFrame property, not directly in the Rotation property. You need to access the rotation values from the CFrame using CFrame:ToEulerAnglesXYZ() or CFrame:ToOrientation().
Use the appropriate method to extract rotation values: Instead of accessing the Rotation property directly, you can use the ToEulerAnglesXYZ() method to extract the rotation values in the desired format (X, Y, Z angles). Here’s an exaple of how you could modify your code to use this method:
local rotation = LS.C0:ToEulerAnglesXYZ()
local rotationString = rotation.X … ", " … rotation.Y … ", " … rotation.Z
LS.C0 is a Cframe. CFrame.Rotation returns a copy of the cframe except the position is set to 0, 0, 0, thus indexing Rotation.X would return 0, and the same for .Y and .Z.
To actually get its rotation values, you can use :ToEulerAnglesXYZ() or :ToEulerAnglesYXZ(). Both of them returns 3 numbers. The former returns the values of the angles as if the rotations were applied in X->Y->Z order, while the latter is if the angles were applied in Y->X->Z order, similar to the Orientation property you see in the properties tab.