Version: Unity 6.1 Alpha (6000.1)
LanguageEnglish
  • C#

HingeJoint2D.useConnectedAnchor

Suggest a change

Success!

Thank you for helping us improve the quality of Unity Documentation. Although we cannot accept all submissions, we do read each suggested change from our users and will make updates where applicable.

Close

Submission failed

For some reason your suggested change could not be submitted. Please <a>try again</a> in a few minutes. And thank you for taking the time to help us improve the quality of Unity Documentation.

Close

Cancel

public bool useConnectedAnchor;

Description

Controls whether the connected anchor is used or not.

By default, this property is enabled which results in the Joint2D.connectedBody and AnchoredJoint2D.connectedAnchor properties being used to constrain the position of the Rigidbody2D the HingeJoint2D is attached to. This is known as a point-to-point constraint.

When this property is disabled, the point-to-point constraint is disabled. This stops the HingeJoint2D from being connected to its anchor point allowing the Rigidbody2D it is added to, to move freely.

Disabling this allows both the motor and limits to be used to constrain and modify angular motion while not constraining linear motion.