Documentation

Unity Engine


User Manual

Script Reference

Unity Engine


useConnectedAnchor

Controls whether the connected anchor is used or not.
Read time 1 minuteLast updated 4 days ago

Definition

  • Type: Property
  • Namespace: UnityEngine
  • Assembly: UnityEngine.Physics2DModule
public bool useConnectedAnchor { get; set; }

Remarks

By default, this property is enabled which results in the _connectedBody and _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.