Documentation

Unity Engine


User Manual

Script Reference

Unity Engine


HingeJoint

The HingeJoint groups together 2 rigid bodies, constraining them to move like connected by a hinge.
Read time 7 minutesLast updated 2 days ago

Definition

  • Type: Class
  • Namespace: UnityEngine
  • Assembly: UnityEngine.PhysicsModule
  • Inherits from: Joint
[RequireComponent(typeof(Rigidbody))]public class HingeJoint : Joint

Remarks

This joint is great for, well, doors, but can also be used to model chains, etc...
The HingeJoint has a motor which can be used to make the hinge spin around the joints axis. A spring which attempts to reach for a target angle by spinning around the joints axis. And a limit which constrains the joint angle.

Properties

Property

Description

angleThe current angle in degrees of the joint relative to its rest position. (Read Only)
extendedLimitsIf enabled, the angle of the hinge is extended to [-360, 360] degrees.
limitsLimit of angular rotation (in degrees) on the hinge joint.
motorThe motor will apply a force up to a maximum force to achieve the target velocity in degrees per second.
springThe spring attempts to reach a target angle by adding spring and damping forces.
useAccelerationDefines whether the HingeJoint.spring outputs accelerations instead of forces.
useLimitsEnables the joint's HingeJoint.limits. Disabled by default.
useMotorEnables the joint's HingeJoint.motor. Disabled by default.
useSpringEnables the joint's HingeJoint.spring. Disabled by default.
velocityThe angular velocity of the joint in degrees per second. (Read Only)

Inheritance

Inherited Members

Operators

Operator

Description

operator ==Compares two object references to see if they refer to the same object.
boolDetermines whether the object exists.
operator !=Compares if two objects refer to a different object.