Search Unity

  1. Get the latest news, tutorials and offers directly to your inbox with our newsletters. Sign up now.
    Dismiss Notice

(Case 1108551) LODGroup.size changes from 1 to 1.000001 when rotating, causing outdated bounds

Discussion in '2018.3 Beta' started by Peter77, Dec 11, 2018.

  1. Peter77

    Peter77

    QA Jesus

    Joined:
    Jun 12, 2013
    Posts:
    5,608
    Changing the GameObject rotation causes the LODGroup bounds to become outdated and the LODGroup UI displays a "Recalculate Bounds" button.

    Looking at the actual data of the LODGroup, gives the impression it's more of a precision issue than actual outdated bounds. The LODGroup "Size" property changes from "1" to "1.000001" if I press "Recalculate Bounds".


    Reproduce
    1) Open attached user project
    2) Open Assets/Scene.unity
    3) Select "Cube" in Hierarchy and duplicate it
    4) Select the duplicated Cube GameObject
    5) Change Tranform Rotation to Y=571.3
    6) Notice the "Recalculate Bounds" button gets enabled
    7) Click "Recalculate Bounds"
    8) Switch the Inspector to "Debug" mode
    Observe the "Size" property is 1.000001 rather than 1 like in the original game object.

    Actual
    Bounds become outdated, because of what seems to be a precision issue. Size changes from 1.0 to 1.000001.

    Expected
    Changing the GameObject Tranform should not cause the LOGGroup Bounds to get outdated.

    Sidenote
    This behaviour causes thousands of LODGroups to become outdated while working on an actual level.
    We workaround this using UnityEngine.LODUtility.CalculateLODGroupBoundingBox() to fix all these outdated bounds at once.
    However, this causes assets in version control to get modified a lot for something that shouldn't be an issue.
     
    Prodigga and LeonhardP like this.
unityunity