How to make my character move according to the curve trajectory

I don’t want the characters can move casually around in the map ,i want my first person character move according to the trajectory i have made. So he can not only walk, turn around automatically,but can also do something like fire or attack controlled by the player controller.
Any method or idea will be much appreciated!