Understanding Unity: Hinge Joint — Anchor Axis, Spring, Motor and Limits

Echo Yin
Women in Technology
3 min readAug 16, 2023

[Personal Devlog: August 16, 2023]

Unity’s Hinge Joint component that constrains the attached game object, allowing it to move like being connected to a hinge. The component can be used in various occasions, such as turbofan, hanging sign posts, openable door, self-rotating gear etc.

This experiment does not cover all the parameters that are included in Hinge Joint component. The rest is up to the reader to find out the best use cases.

Experiments on Anchor of 3D Axis

If the values of axis are set to 0, by default Unity will have the game object rotate around X axis.

If situation demands, it would be better to specify which axis we would like the game object to rotate around.

Rotating on X Axis

X Axis
The game object acts like a sign post

Rotating on Y Axis

Y Axis
The game object acts like a fan

Rotating on Z Axis

Z Axis
The game object oscillates from side to side

Experiment on Spring

Spring option indicates the force applied to the object to “calm” down the rotating momentum.

The value can be set from 0 to infinity. Infinity indicates that the game object will not swing at all.

Spring set to 20
The game object takes more time to swing
Spring set to 100
The game object encounters more resistence to swing

Experiments on Motor

Set Use Motor to true will automatically apply force and spinning velocity to the game object. Target velocity means the maximum velocity the game object can reach by applied force.

If Target Velocity is set to 0, the game object would not move since there is no intrinsic momentum.

Force is set to 30
Force is set to 100

Experiments on Limits

Use Limits parameters will constrain the game object to rotate around pre-destined angle. Bounciness is how “bouncy” when the game object hits the limit.

Bounciness of the game object is also effected by game object’s mass and gravity in Rigidbody component. Better to experiment on all these parameters to obtain desired physics effects.

Let’s set max rotation angle to 60
Changing Max angle to 120
This time the game object rotates on a wider angle

--

--