Hinge Joint は、2 つの リジッドボディ をグループ化し、互いにヒンジで連結されているかのように制約します。ドアに最適ですが、チェーンや振り子などをモデル化するのにも使用できます。
プロパティ | 機能 |
---|---|
Connected Body | ジョイントが依存する リジッドボディ への任意の参照。設定しない場合は、ジョイントはワールド座標 (何もない空間) に接続されます。 |
Anchor | ボディの揺れの中心となる軸の位置。この位置はローカル空間で定義されます。 |
Axis | ボディの揺れの中心となる軸の方向。この方向はローカル空間で定義されます。 |
Auto Configure Connected Anchor | 有効にすると、Connected Anchor の位置が、Anchor プロパティのグローバル座標と一致するように、自動的に計算されます。これは、デフォルトの挙動です。無効にすると、Connected Anchor の位置を、手動で調整することができます。 |
Connected Anchor | 接続されたアンカー位置を手動で設定します。 |
Use Spring | スプリングは、リジッドボディを Connected Body に対して特定の角度に到達させます。 |
Spring | Use Spring を有効にすると使用されるスプリングのプロパティ。 |
Spring | オブジェクトをターゲット位置に移動するための力。 |
Damper | この値が大きいほど、オブジェクトの速度は低下します。 |
Target Position | スプリングのターゲット角度。スプリングはこの角度 (単位は度) の方向に引っ張ります。 |
Use Motor | モーターはオブジェクトを回転させます。 |
Motor | Use Motor を有効にすると使用されるモーターのプロパティ。 |
Target Velocity | オブジェクトが到達しようとする速度。 |
Force | Target Velocity に達するために適用される力。 |
Free Spin | 有効にすると、モーターは回転にブレーキをかけるのに使用されず、加速にのみ使用されます。 |
Use Limits | 有効にすると、ヒンジの角度が Min と Max 値内に制限されます。 |
Limits | Use Limits を有効にすると使用される Limits のプロパティ。 |
Min | 回転が到達できる最小角度。 |
Max | 回転が到達できる最大角度。 |
Bounciness | 最小、最大の制限に到達した際にオブジェクトが跳ね返る量。 |
Contact Distance | ジッターを回避するために、接触は Contact Distance 内に制限されます。 |
Break Force | 接続を解除するために必要な力 |
Break Torque | 接続を解除するために必要なトルク |
Enable Collision | 有効にすると、ジョイントで接続されたボディ間の衝突が可能になります。 |
Enable Preprocessing | 無効にすると、実現不可能な設定 (制約を満たせない状況) を安定させる働きをします。 |
1 つのヒンジを ゲームオブジェクト に適用する必要があります。このヒンジは、Anchor プロパティで指定した点で回転し、指定した Axis プロパティ周辺で移動します。ジョイントの Connected Body プロパティに ゲームオブジェクト を割り当てる必要は ありません 。ジョイントの トランスフォーム をアタッチしたオブジェクトのトランスフォームに依存させたい場合にのみ、ゲームオブジェクトを Connected Body プロパティに割り当てる必要があります。
ドアのヒンジがどのように機能するかを考えると、 Axis は、Y 軸に沿って上向きで正になります。Anchor は、ドアと壁の間の交差部のどこかに置かれます。ジョイントは、デフォルトでワールド空間に接続されているので、壁を Connected Body に割当てる必要はありません。
次は、ペット用の小さなドアのヒンジについて考えると、ペット用ドアの Axis は横向きで、相対的な X 軸に沿って正になります。メインドアを Connected Body に割当てる必要があるため、ドアのヒンジは、メインドアのリジッドボディに依存します。
複数のヒンジジョイントを連結して、チェーンを作成することもできます。チェーンの各連結部分にジョイントを追加して、その次の連結部を Connected Body として追加します。
Did you find this page useful? Please give it a rating:
Thanks for rating this page!
What kind of problem would you like to report?
Thanks for letting us know! This page has been marked for review based on your feedback.
If you have time, you can provide more information to help us fix the problem faster.
Provide more information
You've told us this page needs code samples. If you'd like to help us further, you could provide a code sample, or tell us about what kind of code sample you'd like to see:
You've told us there are code samples on this page which don't work. If you know how to fix it, or have something better we could use instead, please let us know:
You've told us there is information missing from this page. Please tell us more about what's missing:
You've told us there is incorrect information on this page. If you know what we should change to make it correct, please tell us:
You've told us this page has unclear or confusing information. Please tell us more about what you found unclear or confusing, or let us know how we could make it clearer:
You've told us there is a spelling or grammar error on this page. Please tell us what's wrong:
You've told us this page has a problem. Please tell us more about what's wrong:
Thank you for helping to make the Unity documentation better!
Your feedback has been submitted as a ticket for our documentation team to review.
We are not able to reply to every ticket submitted.