Search Unity

Gameobjects moving randomly in editor (So cool!)

Discussion in 'Editor & General Support' started by mat108, Apr 14, 2021.

  1. mat108

    mat108

    Joined:
    Aug 24, 2018
    Posts:
    131
    This has been an issue in every single Unity version I've ever used.

    Maybe Unity could consider including a feature that prevents gameobjects from randomly moving and rotating a little bit every time the user is not watching. Because this makes it hard to work on a level continously. It's not very user friendly you see, ideally we would place a gameobject on position xyz and the next day when we open the editor the gameobject is at still at position xyz, not x.9999, y.9999, z.9998 etc.

    Just maybe, Unity people, if you could consider adding this feature that would be so great!

     
  2. Kurt-Dekker

    Kurt-Dekker

    Joined:
    Mar 16, 2013
    Posts:
    38,697
    Grab a big brown paper bag and take a few deep breaths... this is just an artifact of single precision arithmetic:

    https://en.wikipedia.org/wiki/Single-precision_floating-point_format

    You only get from 6 to 9 digits of precision with 32-bit floats.

    "WAIT A MINUTE!" you say. "17.99997 is barely six digits and I want my money back!"

    Remember in a complicated scene hierarchy, every transform going all the way up to the root of the scene figures into what the actual value of any given leaf node is.

    If you prefer, you can make yourself a custom Transform inspector and have it lop off and round up your numbers to perhaps hundredths or thousanths for display purposes, if it is really giving you deep and abiding layers of angst.

    https://naplandgames.com/blog/2016/08/27/unity-3d-tutorial-custom-transform-inspector/
     
    Last edited: Apr 14, 2021
    Joe-Censored likes this.
  3. Joe-Censored

    Joe-Censored

    Joined:
    Mar 26, 2013
    Posts:
    11,847
    I believe to "fix" this, Unity would need to switch the Vector3 and all positions and rotations over to using the decimal type instead of the float type. That's not going to happen for a variety of reasons.
     
  4. mat108

    mat108

    Joined:
    Aug 24, 2018
    Posts:
    131
    Appreciate the replies. I understand the floating point rounding thing but it doesn't seem acceptable to me that the cumulative effect of this has my objects wandering around creating visible gaps in my level geometry if I open and close the editor several times throughout a week while working on a project. Is this really something users just have to live with? Am I the only one experiencing this?
     
  5. There is a reason why professional level designers always use some sort of grid and snapping. You want to keep your objects at predictable coordinates and avoid 123.323432 units and stuff.
     
  6. mat108

    mat108

    Joined:
    Aug 24, 2018
    Posts:
    131
    So do I. I snap probuilider objects into place with vertex snapping and use progrids. Still have this issue. Always. Every time. On every version of every imaginable permutation of probuilder, progrids and unity. Which I can't imagine is normal and/or acceptable.