Skip to content

Instantly share code, notes, and snippets.

@hulmoHub
Created November 30, 2018 06:25
private void OnTriggerEnter(Collider other)
{
Debug.Log("OnTrriger bu");
//Instantiate(explosion, this.transform.position, Quaternion.identity);
//Destroy(other.gameObject, .1f);
// あたった場合敵を削除
if (other.gameObject.tag == "Enemy" || other.gameObject.tag == "Defender")
{
Instantiate(explosion, this.transform.position, Quaternion.identity);
Destroy(gameObject, .0f);
// ↓↓↓↓ 今回はここをコメントアウト
//Destroy(other.gameObject, .0f);
} else {
Instantiate(explosion, this.transform.position, Quaternion.identity);
Destroy(gameObject, .0f);
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment