Hinge Joint 2D コンポーネントを使うと、Rigidbody 2D 物理システムに制御されるゲームオブジェクトを空間の 1点にアタッチして回転させることができます。回転は、受動的なもの (例えば、衝突に対する反応) と、Joint 2D 自身によるモーターの回転力による能動的なもの、どちらも可能です。ヒンジが完全に 1回転しないように制限したり、1回転以上回転するよう設定することもできます。
プロパティ | 機能 |
---|---|
Enable Collision | ボックスをチェックすると、つながれた 2つのゲームオブジェクトの衝突が可能になります。 |
Connected Rigid Body | Hinge Joint 2D とつなげるもう 1つのオブジェクトを指定します。このプロパティを None のままにすると、Hinge Joint 2D の端は Connected Anchor 設定で定義した空間上の点に固定されます。このフィールドの右にある円を選択すると、接続できるオブジェクトのリストが表示されます。 |
Auto Configure Connected Anchor | このボックスをチェックすると、この Hinge Joint 2D がつながっているもう 1方のオブジェクトのアンカー位置を自動的に設定します。これを有効にすると、 Connected Anchor フィールドを入力する必要はありません。 |
Anchor | Friction Joint 2D の端がこのゲームオブジェクトに (Rigidbody 2D の X, Y 座標で) 接続する位置。 |
Connected Anchor | Friction Joint 2D の端が他方のゲームオブジェクトに接続する (Rigidbody 2D の X, Y 座標上の) 位置 |
Motor | モーターの設定を変更します。 |
Use Motor | ヒンジモーターを使用可能にするには、ボックスをチェックします。 |
Motor Speed | ターゲットのモーター速度 (角度/秒) を設定します。 |
Maximum Motor Force | ターゲット速度に到達するまでにモーターが加えることのできる最大の回転力 (Torque) を設定します。 |
Use Limits | 回転角度を制限するには、このボックスをチェックします。 |
Angle Limits | Use Limits が有効な場合に、その範囲を設定します。 |
Lower Angle | 制限されている回転角の最小値を設定します。 |
Upper Angle | 制限されている回転角の最大値を設定します。 |
Break Force | Joint 2D を解き、削除するのに必要な直線的な力のレベルを指定します。Infinity は解除できないことを意味します。 |
Break Torque | Joint 2D を解き、削除するのに必要な回転力 (Torque) のレベルを指定します。Infinity は解除できないことを意味します。 |
ヒンジジョイントの名前はドアのヒンジのようですが(その実装もできますが)、実際にはより広い意味で特定の支点を中心に回転するものを指します。機械部品、動力付きのタイヤ、振り子など幅広く使用できます。
このジョイントを使うと、 2点をオーバーラップさせる事ができます。それらの 2点は Rigidbody2D コンポーネント 2つか、Rigidbody2D コンポーネント 1つと、ワールド空間での固定位置 1つの組み合わせです。Connected Rigidbody を None に設定すると、Hinge Joint 2D はワールド空間の固定位置につながれます。このジョイントは、接続された Rigidbody 2D GameObject 両方に直線力を与えます。
このジョイントは、オン/オフの切り替えができる回転モーターをシミュレートすることができます。Maximum Motor Speed と Maximum Motor Force を設定して、角速度 ( Torque )を制御すると、2 つのリジッドボディオブジェクトが、互いに相対的な円弧を描くように回転します。円弧に制限をかけたい場合は Lower Angle と Upper Angle を設定してください。
Hinge Joint 2D には以下のとおり同時に満たすべき 3つの制約があります。
このジョイントを使うと回転軸でつながれているかのような反応をする物理オブジェクトを構築することができます。以下はその例です。
すべての 2D Joint に関する便利な情報は、2D ジョイント 詳細とヒント を参照してください。
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.