Search Unity

  1. Welcome to the Unity Forums! Please take the time to read our Code of Conduct to familiarize yourself with the forum rules and how to post constructively.

(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


    QA Jesus

    Jun 12, 2013
    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".

    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.

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

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

    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.