Character Directon Change while moving on a Tilemap (grid)

Please use code-tags when posting code.