Due to floating point precision limitations, it is recommended to bring the world coordinates of the gameobject within a smaller range

Hi!

As the title says, I am getting the “Due to floating point precision limitations, it is recommended to bring the world coordinates of the gameobject within a smaller range” warning on my gameobjects. Any idea about how to solve or deal with this?
Thanks in advance.

If you can travel that far in your game you probably have ( or should have ) some kind of chunking system implemented. Which usually has some form of offset.

I think the common approach to that problem is a worldOffset vector. So if the player gets to a certain points, let’s say (1000,1000) or (-1000,-1000), you reposition a parent object that same amount backwards. Then you’re essentially back at (0,0) with the view of your far coordinates.

I am getting this on a friends PC.
The Project is running fine on my Mac and 3 different Windows10 PCs, only on 1 PC the project is not showing my objects and I am getting that same messege that you have.
Whats different with this 1 PC thats cousing that error?
Same if I compile the game… only on that 1 PC, my level is empty, on every other PC that I have here, works just fine.

I had an object that ran into this error once. The code was like this:

if (up)
{
move = 1f;
}
move *= speed;
x = x + move;

The issue is in the “move *= speed” and it made the object move too fast. I changed the code to this instead:

if (up)
{
move = speed * 1f;
}
x = x + move;