Physics 2D Settings を使用して 2D 物理演算のグローバル設定を行うことができます (menu: Edit > Project Settings > Physics 2D)。
3D のプロジェクトに使用される Physics マネージャー もあります。
プロパティー | 機能 |
---|---|
Gravity | すべての Rigidbody2D オブジェクトに適用される重力の強さ。一般的に重力は Y 軸の負の方向のみに設定されます。 |
Default Material | 2D コライダーに何もマテリアルが指定されてない場合に使用されるデフォルトの Physics Material 2D。 |
Velocity Iterations | 物理エンジンが速度を計算するのに反復する回数。大きくするほど正確な物理計算行われますが CPU 時間を消費します。 |
Position Iterations | 物理エンジンが位置の変更を計算するのに反復する回数。大きくするほど正確な物理計算が行われますが CPU 時間を多く消費します。 |
Velocity Threshold | この値より小さい相対速度でぶつかった場合、その衝突は弾力性のないものとして扱われます (つまり、衝突したオブジェクトはお互いにバウンドしません)。 |
Max Linear Correction | 固定状態を解く時に使用する最大線形位置補正(0.0001 から 1000000 までの値を取れます)です。このプロパティーは行き過ぎ防止に役立ちます。 |
Max Angular Correction | 固定状態を解く時に使用する最大角補正(0.0001 から 1000000 までの値を取れます)。このプロパティーは行き過ぎ防止に役立ちます。 |
Max Translation Speed | 物理計算中の Rigidbody 2D ゲームオブジェクトの最大線形速度。 |
Max Rotation Speed | 物理計算中の Rigidbody 2D ゲームオブジェクトの最大線形速度。 |
Min Penetration For Penalty | この値で定義した半径以上にリジッドボディがめり込む度にインパルスモードの力が加えられます。 |
Baumgarte Scale | 衝突時にオブジェクトが重なった場合、どれだけ素早く解決するかを決定するスケール要素。 |
Baumgarte Time of Impact Scale | インパクトが起こる時間の重複がどれだけ早く解決されるかを決定するスケール要素 |
Time to Sleep | Rigidbody 2D の動きが止まってから、スリープ状態になるまでに経過する時間 (秒単位) 。 |
Linear Sleep Tolerance | Time to Sleep が経過したあと、線形速度がこの値以下である場合 Rigidbody 2D がスリープ状態に移行します。 |
Angular Sleep Tolerance | Time to Sleep が経過したあと、回転速度がこの値以下である場合 Rigidbody 2D がスリープ状態に移行します。 |
Queries Hit Triggers | Triggers にした 2D コライダーと物理クエリ (Linecast、Raycasts など) が交わるときに true を返すべきかどうか。チェックすると、true を返す。チェックしなければ、クエリは true を返さない。 |
Queries Start In Colliders | 物理クエリ (Linecast、Raycasts など) がコライダー 2D 内に侵入を開始しコライダー 2D を検出したとき、true を返すべきかどうか。チェックすると、true を返す。 |
Change Stops Callbacks | これを有効にすると、衝突したオブジェクトのいずれかが衝突直後に削除されていたり移動していた場合の、衝突コールバックの報告をしません。 |
Layer Collision Matrix | レイヤーベースの衝突検出 システムの動作を定義します。 |
Physics 2D Settings は、物理演算精度の限界を定義します。一般的に、より高精度のシミュレーションには、より高いプロセッサ負荷が必要になるので、これらの設定でパフォーマンスと精度という相反する要素のバランスをとります。より詳細な情報はマニュアルのPhysics セクションを参照してください。
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.