The Hinge Joint groups together two Rigidbodies, constraining them to move like they are connected by a hinge. It is perfect for doors, but can also be used to model chains, pendulums, etc.
鉸鏈關(guān)節(jié)由兩個(gè)剛體組成,約束它們像連在一個(gè)鉸鏈上一樣運(yùn)動(dòng),適用于門,不過對于典型的鏈子、鐘擺等同樣適用。

The Hinge Joint Inspector 鉸鏈關(guān)節(jié)檢視面板
Properties 屬性
-
Connected Body 連接體
Optional reference to the Rigidbody that the joint is dependent upon. If not set, the joint connects to the world.
為剛體指定的關(guān)節(jié)連接物,如不設(shè)定,則與世界相連
-
Anchor 錨點(diǎn)
The position of the axis around which the body swings. The position is defined in local space.
主體搖擺圍繞的錨點(diǎn)坐標(biāo),基于本地坐標(biāo)系
-
Axis 坐標(biāo)軸
The direction of the axis around which the body swings. The direction is defined in local space.
搖擺方向的坐標(biāo),基于本地坐標(biāo)系
-
Use Spring 是否使用彈簧
Spring makes the Rigidbody reach for a specific angle compared to its connected body.
彈簧使剛體相對它連接的主體達(dá)到一個(gè)特定的角度
-
Spring 彈簧
Properties of the Spring that are used if?Use Spring?is enabled.
用于如激活Use Spring的彈簧屬性
-
Spring 彈簧力
The force the object asserts to move into the position.
維持對象移動(dòng)到一定位置的力
-
Damper 阻尼
The higher this value, the more the object will slow down.
值越大,對象移動(dòng)越慢
-
Target Position 目標(biāo)角度
Target angle of the spring. The spring pulls towards this angle measured in degrees.
彈簧的目標(biāo)角度。彈簧拉向這個(gè)角度,以角為單位
-
Use Motor 是否使用馬達(dá)
The motor makes the object spin around.
Motor使對象旋轉(zhuǎn)
-
Motor 馬達(dá)
Properties of the Motor that are used if?Use Motor?is enabled.
用于如激活Use Motor的馬達(dá)屬性
-
Target Velocity 目標(biāo)速率
The speed the object tries to attain. 對象設(shè)法達(dá)到的速度
-
Force 力
The force applied in order to attain the speed. 用于達(dá)到目標(biāo)速率的力
-
Free Spin 自由轉(zhuǎn)動(dòng)
If enabled, the motor is never used to brake the spinning, only accelerate it.
如果啟用,Motor永遠(yuǎn)不會破壞旋轉(zhuǎn),只會加速
-
Use Limits 是否有限制
If enabled, the angle of the hinge will be restricted within the?Min?&?Max?values.
如果啟用,鉸鏈的角度將被限制在最大和最小之間
-
Limits 限制
Properties of the Limits that are used if?Use Limits?is enabled.
用于如啟用Use Limits?的邊界屬性
-
Min 最小
The lowest angle the rotation can go. rotation能達(dá)到的最小角度
-
Max 最大
The highest angle the rotation can go. rotation能達(dá)到的最大角度
-
Min Bounce 最小彈跳
How much the object bounces when it hits the minimum stop.
物體碰觸最小限制時(shí)的彈跳值
-
Max Bounce 最大彈跳
How much the object bounces when it hits the maximum stop.
物體碰觸最大限制時(shí)的彈跳值
-
Break Force 破壞力
The force that needs to be applied for this joint to break.
允許這個(gè)鉸鏈破損的力
-
Break Torque 破壞扭矩
The torque that needs to be applied for this joint to break.
允許這個(gè)鉸鏈破損的扭矩
Details 細(xì)節(jié)
A single Hinge Joint should be applied to a GameObject. The hinge will rotate at the point specified by the Anchor property, moving around the specified Axis property. You do not need to assign a GameObject to the joint's Connected Body property. You should only assign a GameObject to the Connected Body property if you want the joint's Transform to be dependent on the attached object's Transform.
單獨(dú)的鉸鏈關(guān)節(jié)要連在游戲?qū)ο笊。鉸鏈會繞著Anchor?屬性指定的點(diǎn),沿著?指定的Axis?屬性方向移動(dòng)。不需要給關(guān)節(jié)的Connected Body?屬性分配游戲?qū)ο蟆V挥邢MP(guān)節(jié)的Transform依賴附加對象的Transform時(shí),才需要分配游戲?qū)ο蠼oConnected Body屬性。
Think about how the hinge of a door works. The Axis in this case is up, positive along the Y axis. The Anchor is placed somewhere at the intersection between door and wall. You would not need to assign the wall to the Connected Body, because the joint will be connected to the world by default.
想一想門的鉸鏈如何工作。Axis在這種情況下是向上的,沿Y軸正向。Anchor在門和墻交點(diǎn)的某處。不需要指定墻給Connected Body,因?yàn)殛P(guān)節(jié)默認(rèn)會和世界相連。
Now think about a doggy door hinge. The doggy door's Axis would be sideways, positive along the relative X axis. The main door should be assigned as the Connected Body, so the doggy door's hinge is dependent on the main door's Rigidbody.
現(xiàn)在再想想狗門鉸鏈。狗門的Axis?應(yīng)該是側(cè)向的,沿著X軸的正向。正門應(yīng)該指定為Connected Body,這樣狗門的鉸鏈即依賴于正門的Rigidbody。
Chains 鏈條
Multiple Hinge Joints can also be strung together to create a chain. Add a joint to each link in the chain, and attach the next link as the Connected Body.
多個(gè)鉸鏈關(guān)節(jié)也可以串起來變成一條鏈條。給鏈條的每一環(huán)添加一個(gè)關(guān)節(jié),并附加下一環(huán)為其Connected Body。
Hints 提示
- You do not need to assign a Connected Body to your joint for it to work.
不需要指派Connected Body?來使關(guān)節(jié)運(yùn)轉(zhuǎn)。
- Use Break Force in order to make dynamic damage systems. This is really cool as it allows the player to break a door off its hinge by blasting it with a rocket launcher or running into it with a car.
用Break Force來制作動(dòng)態(tài)破壞的系統(tǒng)。這確實(shí)很酷,可以讓玩家用火箭發(fā)射器爆破或者用疾駛的汽車撞,來把門從鉸鏈處弄碎。
- The Spring, Motor, and Limits properties allow you to fine-tune your joint's behaviors.
調(diào)整Spring、Motor和Limits屬性可以改變關(guān)節(jié)的作用。