-
-
Save todorok1/661a80d840c94b981ee0969aea21418e to your computer and use it in GitHub Desktop.
衝突相手のタグを確認するサンプル
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/// <Summary> | |
/// コライダーに衝突したゲームオブジェクトを破棄します。 | |
/// </Summary> | |
void OnCollisionEnter(Collision other) | |
{ | |
if (other.gameObject.tag == "Bullet") | |
{ | |
// 衝突した相手を闇の彼方に消し去ります。 | |
Destroy(other.gameObject); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment