- Home /
Moving the world or the Player??
I am planning to make an endless runner game like temple run. need to know techniques for dynamic world creation. should i move the world back or move the player forward,because of the fact that unity has a limit for the values of position.
hi what do you mean by unity has limit for poistion and i would recommend moving player which i way simple than moving world and to make object dynamically appear try using Vector3.distance and calculate the distance and only enable the mesh if the player is close enough
Answer by Fattie · Mar 11, 2013 at 02:38 PM
there is no one good answer. the simple fact is in real-life projects a mix of both techniques may be necessary.
for example, it's true that you don't want position values to grow too big but -- so what? are you sure you'll ever be anywhere near that limit?
a common approach is "9 champs" where you are on a champ 100m square and there are 8 around you. once the player moves more than say 10% off the middle champ, move everything and recenter so that you are again in the middle of 9 champs.
either eis no one decisive answer, and you have to program completely flexibly so that either of the two techniques you mention work perfectly.
then you can test both for performance in your typical situation.
I have tested both the ways,moving the world brings down the fps while moving the player keeps is constant. Should i scale down the world to half of its length
a common approach is "9 champs" where you are on a champ 100m square and there are 8 around you. once the player moves more than say 10% off the middle champ, move everything and recenter so that you are again in the middle of 9 champs.
I got your point,but the problem in repositioning the world and the player after a certain distance creates a lag,which is easily visible.
There is no one specific answer.
It's like asking "How do I make a hit game?"
This is why dozens of engineers work for years to make major game titles.
I've worked on many titles that do precisely what is described, with no lag or jitter.
right now I'm doing one where you fly over a city that moves incredibly fast underneath the aircraft. No lag.
Is there a problem with your "world" is it made up of too many small objects perhaps?
the question is just so very general it is hard to help.
$$anonymous$$gest you post a new simple question "I have this .. screenshot .. and when I move it there is lag"
explain what sort of and how many objects you have etc.
you are looking for "one answer" which does not exist
Your answer
Follow this Question
Related Questions
Move camera or terrain in endless runner? 1 Answer
Endless runner ground movement 0 Answers
How to create a "save me" feature like subway surfers .temple run, etc ? 0 Answers
Endless Runner with List 1 Answer
Making a 3d endless runner? 1 Answer