Can anyone explain why this is not working?
void OnTriggerEnter2D(Collider2D other){
if (other.CompareTag ("Boundary")) {
Debug.Log("Before " + direction);
if ((int)direction == (int)Direction.RIGHT)
direction = Direction.LEFT;
if ((int)direction == (int)Direction.LEFT)
direction = Direction.RIGHT;
Debug.Log("After " + direction);
}
}
This is what I am getting on the Console