void OnTriggerEnter2D(Collider2D collision) { if (collision.gameObject.tag == "Player") { HealthScriptForPlayer4 _health7 = collision.gameObject.GetComponent <HealthScriptForPlayer4>(); _health7.TakeDamgeee(damageamount); } }
void OnCollisionEnter2D(Collision2D collision) { //if (collision.gameObject.tag == "Enemy" || collision.gameObject.tag == "Player") if (collision.gameObject.tag == "Player") { HealthScriptForPlayer4 _health4 = collision.gameObject.GetComponent <HealthScriptForPlayer4>(); _health4.TakeDamgeee(damageamount); } }