How can I set the 2d character to run only in right?

I want to make an 2D runner and i don’t know how to set the character to run endless in right