PcoWSkbVqDnWTu_dm2ix
The Developer Hub is now deprecated and information on this page may no longer be accurate. To see our new and improved documentation, please click here. You can read more about the future of documentation here.
Collapse Sidebar

CFrame

BodyGyro

CFrame

The CFrame property (not to be confused with BasePart/CFrame) determines the target orientation towards which torque will be exerted. Since BodyGyro does not apply translational force, the translational/positional component of the DataType/CFrame, CFrame.p, is ignored. Consider using one of the following CFrame constructors in setting this property: CFrame.fromAxisAngle, CFrame.fromEulerAnglesXYZ or CFrame.fromEulerAnglesYXZ. Beware of gimbal lock as you choose which of these methods and what angles (in radians). Additionally, you could use CFrame.new(gyro.Parent.Position, targetPosition) in order to have the BodyGyro “look at” a targetPosition (DataType/Vector3).