Search Unity

Bug Dear God What Happened

Discussion in 'World Building' started by AxeMalley, Jan 24, 2022.

  1. AxeMalley

    AxeMalley

    Joined:
    Jan 3, 2022
    Posts:
    2
    I was working on unity and had built the general proto type for the level that I am designing as a ship. I moved the ship from o,o,o to 10000,10000,10000 so i could have it out of the way to work on other things. Well All the objects still exist just not in the position the creator intended. I just went back 10 + hours of work because of this. I have some ideas what happened but may someone knows something I do not. Here are the pictures.
     

    Attached Files:

  2. theforgot3n1

    theforgot3n1

    Joined:
    Sep 26, 2018
    Posts:
    208
    It looks like you scaled the ship as well. If you simply move the whole thing it would not break like that. Did you not have a backup of the scene?
     
  3. John_Leorid

    John_Leorid

    Joined:
    Nov 5, 2012
    Posts:
    651
    10000 should actually still be ok, depending on the size of the ship .. if it is really small, this could already be an issue.
    The 3D Space in Unity is not infinite. Each object has a position represented by 3 float values (X, Y, Z).
    A float value has a maximum of 7 digits.

    Just look how with 7 digits, the floating point changes

    1.000000
    0.001000
    1000.000


    You see, the more digits in front, the less digits are remaining at the rear.
    This means, the further away from the origin your objects are, the less precise you can place them.
    At a position of 1Mio units, you can only move them in full units (meters). You cannot move them 0.1 units (aka decimeters) anymore.

    And I think this is what happend here. You moved them so far away from the origin, that their positions were rounded because of a lack of digits in their float values.

    This is why you have to move your coordinate system when you want to create huge worlds or even an entire universe. Otherwise the player can only move in steps of 0.1 meters or more when too far away from the world origin - which feels very messy and glitchy. (it's not just movement, physics also has a lot of troubles out there)
     
  4. John_Leorid

    John_Leorid

    Joined:
    Nov 5, 2012
    Posts:
    651
    Rendering also has problems far away from the world origin. This is a character falling for ~3h xD
     

    Attached Files: