Search Unity

  1. Unity 2020.1 has been released.
    Dismiss Notice
  2. Good news ✨ We have more Unite Now videos available for you to watch on-demand! Come check them out and ask our experts any questions!
    Dismiss Notice

Have you encountered this before...

Discussion in 'General Discussion' started by derf, Sep 5, 2018.

  1. derf

    derf

    Joined:
    Aug 14, 2011
    Posts:
    347
    You setup specific level design and have it all layered out the way you want it, you save the scene and quit for the night. A day or so later you come back to it, start up the editor, check your scene and notice a wall section or 2 are not at the Transform position (XYZ): 5.0; 0.2; 3.5, but is now showing up as 5.0; 0.20001; 3.499999e?

    Very annoying when it does this. I know it is so tiny and I will not notice but sometimes you can now see a tiny seam between objects, like walls and doors, etc.

    I also get this a lot with the Y position (especially after I dupe an object), where it is some weird real number like 1.973564230e-1 or something like that.

    Unity is going to be the death of me yet.
     
    QFSW likes this.
  2. Murgilod

    Murgilod

    Joined:
    Nov 12, 2013
    Posts:
    7,163
    They really should implement a definable epsilon value for in-editor transforms to prevent this sort of thing, yeah.
     
    QFSW likes this.
  3. Unknown33

    Unknown33

    Joined:
    Aug 18, 2018
    Posts:
    170
    Unity has some weird floating point things it does that I can't understand. Try to keep everything in integer values and be very precise.
     
  4. hippocoder

    hippocoder

    Digital Ape Moderator

    Joined:
    Apr 11, 2010
    Posts:
    26,727
    Use descriptive topic titles.
     
    QFSW likes this.
  5. Billy4184

    Billy4184

    Joined:
    Jul 7, 2014
    Posts:
    5,283
    Very annoying stuff. I wrote an editor script to find the nearest integer (or fraction thereof) and realign everything. Shouldn't be necessary though.
     
    Unknown33 likes this.
  6. Unknown33

    Unknown33

    Joined:
    Aug 18, 2018
    Posts:
    170
    I once had a procedural room generator running and even though I had no problems at all with my scripts or design, I would randomly fall through the floor after about 20 rooms were added, usually in the same location (landing of a stairwell) and I could never recreate it exactly, and it would never happen until after at least a dozen rooms were added.

    So no matter how frustrated you get you still haven't experienced true madness.
     
  7. Billy4184

    Billy4184

    Joined:
    Jul 7, 2014
    Posts:
    5,283
    The good thing about procedural generation though, is that you can run a lot of test cases fast ;)
     
  8. Unknown33

    Unknown33

    Joined:
    Aug 18, 2018
    Posts:
    170
    The thing is that it was the exact same prefab as the original room the player started in, which never glitched. I asked and nobody even tried to answer. I will never use Unity's FPS character controller again, I'll tell you that.
     
    Billy4184 likes this.
unityunity