Reference API Roblox

Engine API

Website

Related

Reference API Roblox

BodyGyro

Applies a torque to maintain a constant orientation.

This class is deprecated. It exists only for backward compatibility, and should not be used for new work. AlignOrientation should be used instead.
Tags: [Deprecated]

Member index 6

HistoryMember
731CFrame: CFrame
731D: float
731MaxTorque: Vector3
731P: float
731cframe: CFrame
731maxTorque: Vector3
inherited from Instance
731Archivable: bool
731Capabilities: SecurityCapabilities
731IsInSandbox: bool
731Name: string
731Parent: Instance
731PredictionMode: PredictionMode
731Sandboxed: bool
731UniqueId: UniqueId
576AddTag(tag: string): null
573ClearAllChildren(): null
462Clone(): Instance
573Destroy(): null
486FindFirstAncestor(name: string): Instance
486FindFirstAncestorOfClass(className: string): Instance
486FindFirstAncestorWhichIsA(className: string): Instance
486FindFirstChild(name: string, recursive: bool = false): Instance
486FindFirstChildOfClass(className: string): Instance
486FindFirstChildWhichIsA(className: string, recursive: bool = false): Instance
486FindFirstDescendant(name: string): Instance
563GetActor(): Actor
486GetAttribute(attribute: string): Variant
462GetAttributeChangedSignal(attribute: string): RBXScriptSignal
631GetAttributes(): Dictionary
648GetChildren(): Instances
462GetDebugId(scopeLength: int = 4): string
707GetDescendants(): Instances
486GetFullName(): string
706GetStyled(name: string, selector: string?): Variant
657GetStyledPropertyChangedSignal(property: string): RBXScriptSignal
576GetTags(): Array
576HasTag(tag: string): bool
486IsAncestorOf(descendant: Instance): bool
486IsDescendantOf(ancestor: Instance): bool
664IsPropertyModified(property: string): bool
698QueryDescendants(selector: string): Instances
573Remove(): null
576RemoveTag(tag: string): null
664ResetPropertyToDefault(property: string): null
573SetAttribute(attribute: string, value: Variant): null
462WaitForChild(childName: string, timeOut: double): Instance
731children(): Instances
731clone(): Instance
731destroy(): null
731findFirstChild(name: string, recursive: bool = false): Instance
731getChildren(): Instances
731isDescendantOf(ancestor: Instance): bool
731remove(): null
462AncestryChanged(child: Instance, parent: Instance)
462AttributeChanged(attribute: string)
462ChildAdded(child: Instance)
462ChildRemoved(child: Instance)
462DescendantAdded(descendant: Instance)
462DescendantRemoving(descendant: Instance)
500Destroying()
657StyledPropertiesChanged()
731childAdded(child: Instance)
inherited from Object
731ClassName: string
731className: string
647GetPropertyChangedSignal(property: string): RBXScriptSignal
647IsA(className: string): bool
731isA(className: string): bool
647Changed(property: string)

Description

The BodyGyro object applies a torque (rotational force) on an assembly such that it maintains a constant angular displacement, or orientation. This allows for the creation of assemblies that point in a certain direction, as if a real gyroscope were acting upon it. Essentially, it's the rotational counterpart to a BodyPosition.

If you would like to maintain a constant angular velocity, use a BodyAngularVelocity instead.

The CFrame property controls the goal orientation. Only the angular components of the CFrame are used; position will make no difference. MaxTorque limits the amount of angular force that may be applied, P controls the power used in achieving the goal orientation, and D controls dampening behavior.

History 55

  • 731 Change PreferredDescriptor of maxTorque from to MaxTorque
  • 731 Change Default of maxTorque from to Vector3(400000, 0, 400000)
  • 731 Change PreferredDescriptor of cframe from to CFrame
  • 731 Change Default of cframe from to CFrame(0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0, 1)
  • 731 Change Default of P from to 3000
  • 731 Change Default of MaxTorque from to Vector3(400000, 0, 400000)
  • 731 Change Default of D from to 500
  • 731 Change Default of CFrame from to CFrame(0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0, 1)
  • 731 Change PreferredDescriptor of BodyGyro from to AlignOrientation
  • 726 Change PreferredDescriptor of maxTorque from MaxTorque to
  • 726 Change Default of maxTorque from Vector3(400000, 0, 400000) to
  • 726 Change PreferredDescriptor of cframe from CFrame to
  • 726 Change Default of cframe from CFrame(0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0, 1) to
  • 726 Change Default of P from 3000 to
  • 726 Change Default of MaxTorque from Vector3(400000, 0, 400000) to
  • 726 Change Default of D from 500 to
  • 726 Change Default of CFrame from CFrame(0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0, 1) to
  • 726 Change PreferredDescriptor of BodyGyro from AlignOrientation to
  • 705 Change Default of cframe from to CFrame(0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0, 1)
  • 705 Change Default of CFrame from to CFrame(0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0, 1)
  • 705 Change Default of cframe from CFrame(0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0, 1) to
  • 705 Change Default of CFrame from CFrame(0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0, 1) to
  • 702 Change Default of cframe from to CFrame(0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0, 1)
  • 702 Change Default of CFrame from to CFrame(0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0, 1)
  • 553 Change PreferredDescriptor of maxTorque from to MaxTorque
  • 553 Change Default of maxTorque from to Vector3(400000, 0, 400000)
  • 553 Change PreferredDescriptor of cframe from to CFrame
  • 553 Change Default of cframe from to
  • 553 Change Default of P from to 3000
  • 553 Change Default of MaxTorque from to Vector3(400000, 0, 400000)
  • 553 Change Default of D from to 500
  • 553 Change Default of CFrame from to
  • 553 Change PreferredDescriptor of BodyGyro from to AlignOrientation
  • 516 Change Tags of BodyGyro from [] to [Deprecated]
  • 486 Change ThreadSafety of maxTorque from ReadOnly to ReadSafe
  • 486 Change ThreadSafety of cframe from ReadOnly to ReadSafe
  • 486 Change ThreadSafety of P from ReadOnly to ReadSafe
  • 486 Change ThreadSafety of MaxTorque from ReadOnly to ReadSafe
  • 486 Change ThreadSafety of D from ReadOnly to ReadSafe
  • 486 Change ThreadSafety of CFrame from ReadOnly to ReadSafe
  • 462 Change ThreadSafety of maxTorque from to ReadOnly
  • 462 Change ThreadSafety of cframe from to ReadOnly
  • 462 Change ThreadSafety of P from to ReadOnly
  • 462 Change ThreadSafety of MaxTorque from to ReadOnly
  • 462 Change ThreadSafety of D from to ReadOnly
  • 462 Change ThreadSafety of CFrame from to ReadOnly
  • 210 Change Tags of maxTorque from [NotReplicated] to [NotReplicated, Deprecated]
  • 210 Change Tags of cframe from [NotReplicated] to [NotReplicated, Deprecated]
  • 210 Add MaxTorque
  • 210 Add CFrame
  • 47 Add maxTorque
  • 47 Add cframe
  • 47 Add P
  • 47 Add D
  • 47 Add BodyGyro

Members 6

CFrame

TypeDefault
CFrame0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0, 1

This 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 CFrame is ignored. Consider using one of the following CFrame constructors in setting this property: CFrame.fromAxisAngle(), CFrame.fromEulerAnglesXYZ(), or CFrame.fromEulerAnglesYXZ().

History 9

  • 731 Change Default of CFrame from to CFrame(0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0, 1)
  • 726 Change Default of CFrame from CFrame(0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0, 1) to
  • 705 Change Default of CFrame from to CFrame(0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0, 1)
  • 705 Change Default of CFrame from CFrame(0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0, 1) to
  • 702 Change Default of CFrame from to CFrame(0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0, 1)
  • 553 Change Default of CFrame from to
  • 486 Change ThreadSafety of CFrame from ReadOnly to ReadSafe
  • 462 Change ThreadSafety of CFrame from to ReadOnly
  • 210 Add CFrame

D

TypeDefault
float500

This property defines how much dampening will be applied to the torque used to reach the goal CFrame. When the assembly approaches the goal orientation, it needs to decelerate, otherwise it will rotate past the goal and have to stop and re-accelerate back toward the goal. This often creates an undesirable "rubber‑banding" effect, avoided by applying dampening. The higher this value is set, the greater the dampening curve becomes, or the slower the assembly will approach the goal orientation.

History 6

  • 731 Change Default of D from to 500
  • 726 Change Default of D from 500 to
  • 553 Change Default of D from to 500
  • 486 Change ThreadSafety of D from ReadOnly to ReadSafe
  • 462 Change ThreadSafety of D from to ReadOnly
  • 47 Add D

MaxTorque

TypeDefault
Vector3400000, 0, 400000

This property determines the limit on the amount of torque that may be applied on each axis in reaching the goal orientation (CFrame). If an assembly isn't moving, consider increasing this value and also check that it is not Anchored or attached to any anchored assemblies.

History 6

P

TypeDefault
float3000

This property determines how much power is used while applying torque in order to reach the goal CFrame. The higher this value, the more power will be used and the faster it will be used.

History 6

  • 731 Change Default of P from to 3000
  • 726 Change Default of P from 3000 to
  • 553 Change Default of P from to 3000
  • 486 Change ThreadSafety of P from ReadOnly to ReadSafe
  • 462 Change ThreadSafety of P from to ReadOnly
  • 47 Add P

cframe

TypeDefault
CFrame0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0, 1
This property is deprecated. It exists only for backward compatibility, and should not be used for new work. CFrame should be used instead.
This property is not replicated. Its interface does not cross the network boundary.

History 13

  • 731 Change PreferredDescriptor of cframe from to CFrame
  • 731 Change Default of cframe from to CFrame(0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0, 1)
  • 726 Change PreferredDescriptor of cframe from CFrame to
  • 726 Change Default of cframe from CFrame(0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0, 1) to
  • 705 Change Default of cframe from to CFrame(0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0, 1)
  • 705 Change Default of cframe from CFrame(0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0, 1) to
  • 702 Change Default of cframe from to CFrame(0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0, 1)
  • 553 Change PreferredDescriptor of cframe from to CFrame
  • 553 Change Default of cframe from to
  • 486 Change ThreadSafety of cframe from ReadOnly to ReadSafe
  • 462 Change ThreadSafety of cframe from to ReadOnly
  • 210 Change Tags of cframe from [NotReplicated] to [NotReplicated, Deprecated]
  • 47 Add cframe
Tags: [NotReplicated, Deprecated]

maxTorque

TypeDefault
Vector3400000, 0, 400000
This property is deprecated. It exists only for backward compatibility, and should not be used for new work. MaxTorque should be used instead.
This property is not replicated. Its interface does not cross the network boundary.

History 10

Tags: [NotReplicated, Deprecated]

Settings