private void OnTriggerEnter(Collider other) { Character2D player = other.GetComponent <Character2D> (); if (player != null) { player.TookDamage(damage); Debug.Log("Hit"); } }