xengineer’s diary

結果、メモ的な内容になっています。

Unityのrigidbodyについてる、kinematicについて

またしても、なぜかめりこむ・・・

f:id:xengineer:20141031151159p:plain

なぜだーーーーー!!!!

色々やってみた。しかし直らない・・・

結局直ったのは、Is kinematicにチェックを入れたとき。

f:id:xengineer:20141031151203p:plain

おお!!!直っている!!!!

Is kinematicとは・・・


Unity - Scripting API: Rigidbody.isKinematic

Controls whether physics affects the rigidbody.

If isKinematic is enabled, Forces, collisions or joints will not affect the rigidbody anymore. The rigidbody will be under full control of animation or script control by changing transform.position.

Kinematic bodies also affect the motion of other rigidbodies through collisions or joints.
Eg. can connect a kinematic rigidbody to a normal rigidbody with a joint and the rigidbody will be constrained with the motion of the kinematic body.

Kinematic rigidbodies are also particularly useful for making characters which are normally driven by an animation, but on certain events can be quickly turned into a ragdoll by setting isKinematic to false.

つまり、、、

※以下、Is kinematicをonにした物体のこと == Kinematic bodies とする

Kinematic bodiesは、物理演算が効きまてん。
移動したいときは、直接transformをいじりましょう。(座標軸を、スクリプトか手動でいじる)
Kinematic bodiesは、衝突で影響は受けないけども、衝突した相手の動きには影響を与えます。
joint(って何?)で他のrigidbodyとつなげることもできて、つながったrigidbodyは、Kinematic bodiesの制約の影響を受けます。

えーと・・・ほんとに動かしたくない壁的なものは設定しとくといいのかな?
っていう印象。

それでいうと、今回設定した壁とか床はこれでいいのか・・・
なんだか難しいけど一旦そんな理解をしておこう。