Search Unity

5.1: Invalid optimized game object

Discussion in 'Editor & General Support' started by Deleted User, Jun 9, 2015.

  1. Deleted User

    Deleted User

    Guest

    I started getting this error whenever I run the game in the editor. It's coming from the camera - if I disable the camera component of the main camera, the error stops. I get one report each frame. I tried disabling all other objects in the scene but I'm still getting it, so I'm not sure what it's tied to.
    Does anyone know what the issue could be?

     
  2. Sebioff

    Sebioff

    Joined:
    Dec 22, 2013
    Posts:
    218
    Getting the same error spammed to the console. In my case it starts happening as soon as the optimized game object has a parent assigned (is not within the root level of the hierarchy).
     
  3. Deleted User

    Deleted User

    Guest

    What IS an optimized game object anyway?
     
  4. Sebioff

    Sebioff

    Joined:
    Dec 22, 2013
    Posts:
    218
    It's that checkbox labeled "Optimize Game Objects" that you can find in the "Rig" tab of the import settings of your model. It gets rid off unnecessary transforms in your objects hierarchy (e.g. doesn't create individual transforms for each bone), which improves animation performance quite significantly.
     
  5. Arainami

    Arainami

    Joined:
    Dec 2, 2014
    Posts:
    11
    I transferred my project to Unity 5.1.0 f3. All broken :( I used models with optimized transforms - now they all return errors. Any model that optimize bones with extra transforms to expose - produces an error if you put it on the scene at any parent transforms. Even if the optimization was made by the inspector.
    Oh, and they give an errors when they get to the camera render.
     
  6. hogwash

    hogwash

    Joined:
    Oct 12, 2012
    Posts:
    117
    Last edited: Jun 11, 2015
  7. liang.zhao

    liang.zhao

    Unity Technologies

    Joined:
    Oct 30, 2014
    Posts:
    4
    Sorry, it's a stupid mistake. Should not assert when the parent of the character isn't NULL. Will fix it. Btw, it only assert in the editor.
     
    yuanxing_cai likes this.
  8. hogwash

    hogwash

    Joined:
    Oct 12, 2012
    Posts:
    117
    Is there an ETA on when the next patch will be released? This really is a show stopper for us in terms of productivity.
     
  9. liang.zhao

    liang.zhao

    Unity Technologies

    Joined:
    Oct 30, 2014
    Posts:
    4
    One week? Just estimation.
     
  10. hogwash

    hogwash

    Joined:
    Oct 12, 2012
    Posts:
    117
    So has this been fixed in 5.1.0p1? I can't see any mention of it in the release notes.
     
  11. hogwash

    hogwash

    Joined:
    Oct 12, 2012
    Posts:
    117
    Nope doesn't look like it.
     
  12. Devil_Inside

    Devil_Inside

    Joined:
    Nov 19, 2012
    Posts:
    1,119
    I am too getting this spam in 5.1.0p1
    Any workarounds till it's fixed?
     
  13. manutoo

    manutoo

    Joined:
    Jul 13, 2010
    Posts:
    524
    Still getting it with 5.1.1f1 released yesterday.

    This makes looking for errors in the Editor extremely painful... o_O
     
  14. Velo222

    Velo222

    Joined:
    Apr 29, 2012
    Posts:
    1,437
    I just upgraded to 5.1.0p1 and started getting this error for the first time as well. When a certain unit/character "becomes visible" by the camera, I get this error spammed in the console "Invalid optimized game object".

    My guess is it has to do with import rig settings on certain models/characters, and something with these new patches doesn't upgrade or transition well.

    I hope there's an easy fix for this on Unity's end. My previous Unity version was 5.0.x....... and this error was not present then.
     
  15. hogwash

    hogwash

    Joined:
    Oct 12, 2012
    Posts:
    117
    Yep still getting this in all 5.1.0 patch releases and 5.1.1f1. What build will this issue be fixed in!?
     
  16. KB73

    KB73

    Joined:
    Feb 7, 2013
    Posts:
    234
    just throwing it out there as i haven't seen this error myself. How about unchecking the optimize game object ( in the older version) then recheck it in the new version? or even just uncheck it in the current builder, reimport all then re-enable?..does it still occur?
     
  17. hogwash

    hogwash

    Joined:
    Oct 12, 2012
    Posts:
    117
    Yes this problem still persists. The problem is caused by a combination of using 'Optimize Game Objects' and parenting the model to another GameObject.
     
  18. Sebioff

    Sebioff

    Joined:
    Dec 22, 2013
    Posts:
    218
    Looks like it has been fixed in 5.1.1p1, nice!
     
    Last edited: Jun 24, 2015
  19. bratzka

    bratzka

    Joined:
    Dec 24, 2014
    Posts:
    7
    i unchecked all 'Optimize Game Objects' ticks in my project but i still get spammed... i have also 5.1.1p1
     
  20. Devil_Inside

    Devil_Inside

    Joined:
    Nov 19, 2012
    Posts:
    1,119
    Weird, it was fixed for me in 5.1.1p1
     
  21. manutoo

    manutoo

    Joined:
    Jul 13, 2010
    Posts:
    524
    It's fixed for me in 5.1.1p1 .
     
  22. Velo222

    Velo222

    Joined:
    Apr 29, 2012
    Posts:
    1,437
    Patch 5.1.1p1 fixed this specific error for me as well, however for some reason some of the child objects of the optimized game object are bigger than they should be (like 2-3 times as big) -- whereas they weren't before.

    The odd thing is, everything is of normal size in the "scene" view before I hit play. Then once I hit play, the character's helmet, shield, and sword increase in size dramatically.
     
  23. Sebioff

    Sebioff

    Joined:
    Dec 22, 2013
    Posts:
    218
    We had the same problem...I think 5.1 might have changed something about scale curves in animations? Make sure that your animations don't scale anything.
     
  24. Velo222

    Velo222

    Joined:
    Apr 29, 2012
    Posts:
    1,437
    Is there a way to do this in Unity, or is it something inherent in the animation itself that would need to be fixed by whoever originally created the animation?

    **Edit: I found out that the animator component on the character in question actually had the wrong avatar applied to it. The patch update grabbed the wrong avatar apparently (it applied a mecanim avatar with a similar name, but only the first one in the list). Now everything works normally when I manually applied the correct avatar. :)
     
    Last edited: Jun 26, 2015
    Arainami likes this.