Fixed Joints は、オブジェクトの動きを別のオブジェクトに依存するよう制限します。これは、親子関係 に若干似ていますが、トランスフォーム 階層ではなく、物理特性を通して実現されます。簡単に分解したいオブジェクトがある場合や、親子関係なしで 2 つのオブジェクトの動きをつなげたい場合などが、最適な使い道です。
プロパティ | 機能 |
---|---|
Connected Body | ジョイントが依存する リジッドボディ への任意の参照。設定しない場合は、ジョイントはワールド座標 (何もない空間) に接続されます。 |
Break Force | 接続を解除するために必要な力 |
Break Torque | 接続を解除するために必要なトルク |
Enable Collision | 有効にすると、ジョイントで接続されたボディ間の衝突が可能になります。 |
Enable Preprocessing | 無効にすると、実現不可能な設定 (制約を満たせない状況) を安定させる働きをします。 |
ゲーム内で、オブジェクトを完全にまたは一時的に結合したいシナリオがあるとき、固定ジョイントは、必要な効果を実現するのにオブジェクトの階層で変更する必要がないため、こうしたシナリオを使用するのに適した コンポーネント です。欠点は、固定ジョイントを使用する任意のオブジェクトに リジッドボディ を使用する必要があることです。
例えば、粘着手榴弾 を作成したい場合、別のリジッドボディ(敵など)との衝突を検出するスクリプトを記述し、固定ジョイント自体をそのリジッドボディに追加することで実装できます。これで、敵が動くと、ジョイントが手榴弾にくっついたままになります。
Break Force や Break Torque プロパティを使用して、ジョイントの強さに上限を設定できます。これらが無限ではなく、上限より大きい力やトルクがオブジェクトに適用される場合、その固定ジョイントは分解されず、またその制約によって限定されることはありません。
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.