private void OnTriggerEnter2D(Collider2D collision) { MoveControl player = collision.gameObject.GetComponent <MoveControl>(); if (player != null) { player.ChangeHealth(-1); } }