Left-right movement without rotating

the object should move left and right along the wall without rotating. How can I best implement this:

Thanks in advance!

You could base it on this:

https://answers.unrealengine.com/questions/1023488/movement-along-the-wall.html

Just get rid of rotation.

I would leave out the rotation, but it doesn’t work. In this one example, it only works if the object is on the wall. The object must go independently in the direction of the wall