- Home /
Move player or background
Hello everyone,
I am developing temple run like game. I am in little confusion that should i move the player forward or should i move the backgrounds towards the player and do not change player position?
For infinite runners I would suggest moving the environment, with a stationary character. Otherwise after moving a large distance from the origin you can start to get larger floating point errors, which can cause z fighting on planes and similar problems.
If you don't move the world you can set the world to Static to reduce drawcalls, for the floating point issue I guess you can just reset the position of the player and the world to Vector3.zero once you reach x/y > 9000
true, can have reduced benefit if you are pragmatically generating levels or repositioning pooled objects lots as they will not be baked into combined meshes automatically, and doing it manually eradicates the benefit of marking them as static.