Hello!
I need assistance on a problem, I’m playing with huge scale scenes, and in this case a Solar System.
Currently there is 1 planet and 1 yellow star.
The thing is, that due to the floating point limitations, I cannot just move a planet or player over 100000 Unity Units without getting loss in precision.
I’ve been searching, and found this: “You don’t move in the universe, the universe moves around you.”
Also I watched Unite 2013 where KSP dev told the same thing.
The player’s ship has a simple rigidbody and a controller to move it around. But It cannot move up or down in space.
So, I have all GameObject’s (Except the Player) in a parent GameObject, called Universe, now I need to keep the player in the middle of the scene, and make the Universe GameObject move making it look the player would be moving.
First thought is to have triggerboxes all around player, and make universe move to the other direction the triggerbox hit was. But its pretty inaccurate.
Second thought is doing everything in a universe mover script, and make the player reset its position with FixedUpdate function. But how do I get where I am going? The ship controller script is just adding force to the rigidbody when button was pressed.
Third thought is multiple scenes, having an trigger around the edges, and then loading the new scene. Problem is that the planet’s have orbits, and rotations.
I like the Second one most, I know how to keep player in the middle, but what about moving? And what if there are NPC’s or Asteroid moving at high speed, how are they going to look?
Help.