5
2

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 5 years have passed since last update.

一方通行なコライダ

Last updated at Posted at 2013-08-04

下からは乗れて上からは乗れない足場や、右から入れて左から通れない一方通行の壁を作るには、トリガーコライダ(IsTriggerをオンにしたコライダ)と普通のコライダを組み合わせる方法があります。

  ___________
  |   足場  |
+-+---------+-+
| |_________| |
|   トリガー   |
+-------------+

足場のコライダの下にトリガをAAのように配置して、トリガに触れた時足場とキャラの間の衝突を無効にします
プレイヤーが離れたら無効化を解除して足場の衝突を復活させます。トリガと足場の配置がうまくいっていれば足場がプレイヤーを押し出してくれます。

(参考: Unity Answers - Eficient one-way collider)

5
2
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
5
2

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?