How to do an infinite map 2d scroller?

You actually dont do that. What 2d side scroller maps normally do, its to never actually move the player, they just move the environment. What you can try in ue4, is to teleport the character back. think you have sections A-B-C-D on a level. When you get to section C, then section A is morped to section D, and section B its morphed to section E once the player reaches D. You make sure the player its in the middle or the beggining of section D when you teleport him back. If you do that carefully, it can look like its infinite, but of course, you need to sync the beggining with the end of the “map” so it is exactly the same so it doesnt change when you teleport the character back. This teleporting would be the exact same thing that mario 64 does in its famous infinite stairs.