How to make a push/pull system?

I wish to make a push/pull system where the player can hold a button and move a part, but I have already done this, my new problem is trying to limit the player to a track so they can move forwards and backwards in a circle, like this:

How could I do this?

Maybe the use of math.sin() could work for you?

I know this is used for making a circular loop so, you can try to use this function to ake a player stay on a circular loop path.

This post might be able to help you out:

(accidental bump, didn’t realize how old this post was)