Skip to content

Instantly share code, notes, and snippets.

@todorok1
Created Sep 3, 2020
Embed
What would you like to do?
衝突相手のタグを確認するサンプル
/// <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