- Home /
Move camera or terrain in endless runner?
Hi ya'll I wanna create an endless runner game where the player does not change direction (unlike temple run). What I wanna know is if I move both the player and the camera, will that affect the game performance if the player goes really far along the Z axis? coz I know that's a tad easier to create then moving the terrain and obstacles underneath the player...
Answer by JoeStrout · Oct 13, 2014 at 08:46 PM
If you run thousands of kilometers away from the origin, you'll start to run into floating-point precision issues.
But let's say your guy runs 10 km/hr... the player would have to run continuously for over 4 days to reach even 1000 km.
So, you can probably just move the camera and not worry about it.
If it later proves to be a problem, you can just periodically move everything back towards the origin -- say, every 100 km or so (which would still take 10 hours at the above rate!).
Oh yeah, and no, as far as performance goes it makes no difference whether you move the camera or move the scene.
Thanks JoeStrout! I really appreciate it. I just hope no one plays my game for 4 days straight :-D
Your answer
Follow this Question
Related Questions
How to create a "save me" feature like subway surfers .temple run, etc ? 0 Answers
Endless Runner with List 1 Answer
Moving the world or the Player?? 1 Answer
Making a 3d endless runner? 1 Answer
Endless runner ground movement 0 Answers