In my Game I require a working space of preferably around a few hundred Km. Looking at previous Questions the answers given are usually either Scale down the scene or use some form of spacial partitioning [breaking down the space into smaller chunks].
At standard scale under 10,000 is mostly jitter free
Unless I'm doing something wrong scaling down the scene doesn't seam to fix anything as if I scale down everything by 100, the "jitter point" just appears 100 times closer so I'm stuck with the same overall world size.
If I go the spacial partitioning route and assuming and I don't have the chunks overlapping [which would make the transitions smoother] increasing the size of the scene cubes for each extra layer 10,000 = 1, 50,000 = 27 , 90,000 = 125 chunks which is an insane number of chunks for the size I require.
Assuming there is a way to convert the Vector3's to double precision floats I would have an insane workspace before the "jitter point" appears [~30au or the distance from the sun to Neptune!!]
SO is there any way to use double precision vector3's or some method I haven't found to allow unity to create Scenes the size I require
Ok ive come up with the following Idea, Any comments / improvements are welcome
if (check) {
float dist = Vector3.Distance (transform.position, Vector3.zero);
if ( dist > 8000f) {
foreach (GameObject obj in Object.FindObjectsOfType (typeof(GameObject)))
if (obj != gameObject && obj.transform.root != transform.root && obj.layer != 10 && obj.transform == obj.transform.root)
obj.transform.position -= transform.position;
transform.position = Vector3.zero;
}
checkpoint = ((8000f - dist) / 600f);
timer = 0;
if (checkpoint > 0.5f)
check = false;
} else {
if (timer > checkpoint) {
check = true;
}
}
timer += Time.deltaTime;
Basically it moves the entire world bar anything that is part of the game object this is attached to or anything on layer 10 which I have called "GlobalPosition" but only does this when the player is half a second from the 8km border at top speed.