How to set max position(or edge) to move left and right on the floor for endless runner?

I am creating an endless runner game and it moves continuously move forward direction. (kind of obstacle avoiding) .when try to move left and right it goes outside of the floor .so I want to set the maximum sideways position. I didn’t do the lane system because my goals are move left and right freely on the floor and it should not fall off the floor when reaches the edge (using default third person character blueprint )