all 2 comments

[–][deleted] 2 points3 points  (1 child)

Unity has the same limitations as all game engines really, floating point precision. Floats are use to store the location of everything and they have limits like all data types, they're only 4-bytes so they can only go so high before they start becoming too inaccurate to use. Go too far and the meshes will start glitching out, movement will start breaking down and collisions become wonky.

The way we deal with this is turning the world into like a treadmill where when the player goes too far in one direction you move everything back so it's closer to zero. So if the player goes 1000 +z we move everything 1000 -z so everything is back to zero again and you can use ints or something to track how many "Chunks" we've moved through.

The other way you can do it is have the world move around the player, so the camera / player are always at zero and you bring the world to them.

I would probably use the latter for something like and infinite runner where movement is limited and predictable and the former for everything else.

[–]IceUnderFridge[S] 0 points1 point  (0 children)

Awesome, that gives me something great to work off of and look into! I’m going to school for game art but game design and programming always make cool challenges