update character direction