Asking about break rotation

unfortunately it’s not work cause i need to make rotation to right and left but i need to prevent him from move back cause i make endless runner game do you have another solution bro?