Otherwise my enemy would get mad around a ladder and go back and forth on it.
private void OnTriggerExit2D(Collider2D collision)
{
if (collision.gameObject.layer == LayerMask.NameToLayer("Ground"))
{
// Turn around
transform.localScale = new Vector2(-transform.localScale.x, transform.localScale.y);
}
}