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.
  2. Unity 2022.2 is now available as the latest Tech release.
    Dismiss Notice
  3. We are making some changes to the DOTS forums.
    Dismiss Notice
  4. Join us on Dec 8, 2022, between 7 am & 7 pm EST, in the DOTS Dev Blitz Day 2022 - Q&A forum, Discord, and Unity3D Subreddit to learn more about DOTS directly from the Unity Developers.
    Dismiss Notice
  5. Have a look at our Games Focus blog post series which will show what Unity is doing for all game developers – now, next year, and in the future.
    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


    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.