Zig zag mobile movement

Hi,

I need help on how to create a character control system in which when the game starts the player starts moving in one direction and when the player clicks on the screen in the other direction, the idea is to make the character do something like a zigzag

Forgive my poor English if you did not understand something