0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 3 years have passed since last update.

PhysicsMaterial2Dの優先順位

Posted at

Collider2DとRigidbody2Dがアタッチされたオブジェクトには、PhysicsMaterial2Dを入れる場所が2か所あります。

image.png

どちらが優先されるのか?
マニュアルによると、

Collider2D で指定された PhysicsMaterial2D の優先順位が一番高く、次いで Rigidbody2D で指定された PhysicsMaterial2D、グローバルの PhysicsMaterial2D の順位です。

となります。グローバルの PhysicsMaterial2D というのは
2022-02-16_225356.png

これです。
ここにも何も設定されていなかった場合は、

PhysicsMaterial2D.friction = 0.4
PhysicsMaterial2D.bounciness = 0

が使用されます。

0
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?