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. We’re making changes to the Unity Runtime Fee pricing policy that we announced on September 12th. Access our latest thread for more information!
    Dismiss Notice
  3. Dismiss Notice

Bug "Optimize Game Objects" not behaving as expected

Discussion in 'Animation' started by CDGKen, Apr 7, 2021.

  1. CDGKen

    CDGKen

    Joined:
    Jun 28, 2019
    Posts:
    30
    Hello,

    We're currently optimizing our game and noticed that CPU usage is very high for our characters due to the complexity of the hierarchy of the rig. I've been looking into the "Optimize Game Objects" flag to simplify the hierarchy, but I can't seem to get it to work properly.

    When I turn on the flag the character model completely disappears. The reason this happens is because we remove the Animator component on the imported model because we want it to be placed somewhere else with an Avatar assigned. The moment the Animator component is removed though, the model disappears along with it. Oddly enough, if you keep the Animator component but instead only disable it, the model is still visible, however if I try to put the Animator anywhere else with an assigned Avatar, it simply does not work. Is that correct behaviour?

    I have attached an image to show how it's set up. The Skeleton_ModelVariant is the model with the Animator removed, which is instead placed on the root GameObject. You can see in the scene view that the model is completely missing (there's only text and some colliders visible). We could get around this by just using the Animator that is automatically generated when importing the FBX file, but it would mean changing code in a bunch of places that assume the Animator is on the root.

    optimize_issue.PNG

    I'm currently using 2019.4.17 LTS. Any help with this is much appreciated!

    Kenny
     
    Last edited: Apr 7, 2021
    Immersive-Matthew likes this.
  2. Immersive-Matthew

    Immersive-Matthew

    Joined:
    Mar 24, 2020
    Posts:
    129
    Did this get resolved?
     
  3. CDGKen

    CDGKen

    Joined:
    Jun 28, 2019
    Posts:
    30
    As of 2019.4.25, it still happens.
     
  4. floky

    floky

    Joined:
    Oct 6, 2010
    Posts:
    273
    This flag has an even uglier issue that makes it obsolete in certain use-cases.
    See the issue described here:
    https://fogbugz.unity3d.com/default.asp?1386353_1unf41gblo5threq

    In short, you can't use "Optimize Game Objects" with models for which you want to use Unity's "Animation Rigging" package. (for example to apply a "Look At" constraint on the head of the model)
    No valid response yet from QA.
     
    Immersive-Matthew likes this.