When making an endless runner how do I set the origin of the world to the character?

I want to make an infinite runner but the problem is if the character goes too far from the origin, It just vanishes. I have read some methods to make the game work as if the character is the origin of the world. How do I do it?

You would most likely let the Character play its running animation on the place, so he doesnt move, but play the animation. Now you can let the floor move under him. You could do this with an array or something.

You always delete the first item, which is the floor that is farest behind the player. Track its pathlength to the player and if its away too far away from him you delete it. On the other side, you add a new piece of floor to the end of the array each time you delete the one at the start. The array could be an array of Blueprints, with a static mesh and some functions.
Your floor parts must alle have the same length. Like 200 Units. When you spawn a new piece and add it to the array, you need to think about how to place it exactly at the front of the previous floor piece. You can calculate this by taking the length of the floor mesh.

Here is a picture from the side

http://puu.sh/aU9qz/96a9a238ac.png

I have thought of this but this wont work on what I am making cause here my character is a physics body. Calculations would become both inaccurate and complex if I make a moving platform.

Another thing I can think of is start on 1 side of the map and when the player reaches the other side, give a player a small break i.e. not spawn any obstructions then move all the platforms and the player top the start location. I would do but I fell there is an alternative UE4 so waiting it.

Why won’t this work?
What calculations are you talking about? The Movementspeed?
You just need to move the the platform with the same movementspeed as the player would have and trigger the animation of the player with the movementspeed of the Platforms in the animation blueprint.
I made this type of a game in Unity and it worked perfectly. I won’t think that this can’t be done in UE4.

I have been stumped on this also. I’m moving to UE4 from a different utility and cant figure out which function(s) and terms I need to call to build the array. I have been able to learn the blueprint syntax so far very well

I’m making a side scrolling endless runner and here’s how I set it up…

I have one BP with all but the Yellow starting zone included. Each of the boxes shown here is a component in the BP. On level load, platforms (their own BP) spawn into the Platform spawn area of the Pink area below randomly. I have box triggers in each platform BP to delete one if they overlap. In the Base level spawn area of the Pink zone I spawn a flat line of the platforms as the base area the player can always run. When the player reaches the spawn trigger, I spawn another copy of this full BP (again, without the Yellow section) to the right of the starting one butted against each other so no gaps. The De-spawn trigger overlaps the newly spawned area allowing the player to get into the new zone and then de-spawns all pieces of the previously spawned in section. I do this by adding everything to an array as spawned in and then just destroy everything in the array when the De-spawn trigger is hit. I also have a kill trigger at the bottom in case the player falls below the level (it’s possible for the base track to have gaps due to the platforms spawning in the Pink zone). The un-marked boxes above and below are just blocker volumes to keep the player contained.

The Yellow starting zone and the procedural spawning BP outlined are the only things in the level. When the game starts, the player presses a button to indicate they are ready and then I have the player controller start running and the player simply has to jump and interact with the obstacles as they come. Works well so far. PM if you want more details on how I set things up. Hope this helps.

My character is a physics actor having many physical collisions and other effects. Too complicated if I have a static object.

Btw this is what I was talking about World Composition in Unreal Engine | Unreal Engine Documentation

Gooner44, since you’re moving the player forward, instead of the platform, have you managed to hit the 10,500m mark where your player will be destroyed? how have you solved that part?