Search Unity

5.3 Animation Scale Bug?

Discussion in 'Animation' started by AllanMSmith, Jan 6, 2016.

  1. AllanMSmith

    AllanMSmith

    Joined:
    Oct 2, 2012
    Posts:
    180
    Hey,

    We are developing a pretty big project for some time, and we upgraded to Unity 5.3.1p1 (because of the particles bug we went to the patch version), and everything was working normally on the Editor... however when we made a new build for iOS, for reasons I cannot even begin to comprehend, our units have "random" scale values... from tiny to super ultra huge...

    Considering we havent changed a thing about animations in the project for the past... wow I dont even know, 6 months, this is certainly something related to the new Unity version, was working fine on Unity 5.2.x, and just bugs on the device, doesnt bug on the editor. Its strange because even 2 instances of the same unit have different scales, and depending to where they move... if they are moving attacking or simply doing nothing, their scales vary greatly. And whats more mystical is that the size changes are smooth... so a unit might be very small and move around a little bit and it gradually grows to super huge in a couple seconds... then comes back to its original scale... and we dont even scale the units, they all should be scale 1,1,1 for batching purposes.

    Anyway... I dont know what is happening. Apparently, if we remove the Optimize option on the RIG of the unit, this normalizes but then again we dont want to remove the optimization. Our game has tons of units at the same time on screen, its a mobile game, and having all the bones moving around will certainly slow down our game.

    So... anyone else with this issue?

    PS: Heres a screenshot to illustrate... all those... blue monsters, and the skeleton, should be exactly the same size... they are just the model dragged to the scene, no code controlling them at all, and they just stand there on Idle... which proves its not code related neither animation related.

     
  2. Kukuruz

    Kukuruz

    Joined:
    Jan 8, 2014
    Posts:
    7
    I can confirm that when Optimize Game Objects is enabled, weird scaling occurs. Disabling it fixes the problem.

    There is no problem in the editor, but when run on iOS(only tested on this for now) the problem occurs.
    Unity versions: 5.3.1f1 and 5.3.1p1.
     
  3. mike.xie

    mike.xie

    Joined:
    Nov 17, 2015
    Posts:
    7
    Last edited: Jan 7, 2016
  4. AllanMSmith

    AllanMSmith

    Joined:
    Oct 2, 2012
    Posts:
    180
    Soooo... should I start removing the "optimize" option or is this getting fixed soon?

    Edit: Dont mean to be rude... I ask because its going to be a ton of work to remove optimize from about a hundred of units, and then when its fixed I will have to put it back to a hundred units... so rather not have to do it.
     
    Last edited: Jan 8, 2016
    mike.xie likes this.
  5. theANMATOR2b

    theANMATOR2b

    Joined:
    Jul 12, 2014
    Posts:
    7,790
    Submitting a bug is the only way to confirm Unity is aware of, tracking and actively working on a fix.
     
  6. mike.xie

    mike.xie

    Joined:
    Nov 17, 2015
    Posts:
    7
    As far as the rotate bug I encountered (likely related to this scale bug), a bug report has already been filed along with a project reproducing the issue.

    In fact two bug submissions were made after I figured the tool that comes with Unity is a better way to do it. =P
     
    Last edited: Jan 11, 2016
    theANMATOR2b likes this.
  7. MoinTom

    MoinTom

    Joined:
    May 8, 2015
    Posts:
    15
    Hello everyone,
    we are facing the same problem right now. At least the effect is the same. But we noticed that not the scale of the animated objects changes. Its the transform.postion that changes in a weird way (it seems like just the Y-Axis is effected). The scaling effect just occur because of the fact that the object moves toward the main camera.

    We using a MeshAgent (for movement) and custom rotation (for aiming).

    Unit <- MeshAgent + UnitController
    --- CharModel <- Rig + Animation
    --- UI <- InGame HUD

    The UI stays always on the "right" position (moves probably to the expected positions etc.), but the CharModel changes the position in a random way (but smoothly like it's animated).

    Here an example of an Unit that is moved to the exact same position (in Editor vs. Mobile):
    Editor:
    pos = (2.3, 0.1, -2.5), localPos = (0.0, 0.1, 0.0), rot = (-0.2, 0.1, 0.6, -0.7), localScale = (1.0, 1.0, 1.0), parentLocalScale = (1.0, 1.0, 1.0)

    Mobile (Android in this case):
    pos = (2.3, -0.9, -2.5), localPos = (0.0, -0.9, 0.0), rot = (0.1, 0.2, -0.7, -0.6), localScale = (1.0, 1.0, 1.0), parentLocalScale = (1.0, 1.0, 1.0)

    (Data read from "CharModel"; so the parent is "Unit")

    It's noticeable that the position and rotation is different. The rotation is just different because our Unit is facing the opponent Unit (to shoot at). So because of the different positions we have a different rotation.
    However the position seems to be just slightly different, but we are using a small scale for our world. So even this slightly difference makes a "huge" difference. Since the Y-Axis is negative our Unit is under the ground Plane and hidden.

    We tried many things to fix this, but we are running out of options. "Optimize Game Object" was one of our tries. Didn't work for us. Maybe we are facing a different Problem here, but at least the effect and the context seems to be the same. The problem occurred with Unity 5.3+. We hadn't any problems with Unity 5.2.3f1.

    Thanks a lot guys and best regards,
    Tom
     
  8. AllanMSmith

    AllanMSmith

    Joined:
    Oct 2, 2012
    Posts:
    180
    This seems to me like a pretty important bug... I was forced to go back a version to have my game working properly again... and as people mentioned I also submitted a bug report. Lets hope it gets fixed soon, as the recent patch mentions nothing about this =/
     
    theANMATOR2b likes this.
  9. mike.xie

    mike.xie

    Joined:
    Nov 17, 2015
    Posts:
    7
    We too, have rolled back to 5.2.4. It'd be nice to get some acknowledgement on this-- it seems Optimize Game Objects is broken in a plethora of ways. This is only one among three different threads on it in the last week.
     
  10. Arainami

    Arainami

    Joined:
    Dec 2, 2014
    Posts:
    11
    We are faced with the same problem in our project :(
     
  11. AllanMSmith

    AllanMSmith

    Joined:
    Oct 2, 2012
    Posts:
    180
    Hey, just wanted to update you all that I received an e-mail informing me this bug has been solved for Unity 5.4, so hang in there!
     
  12. Arainami

    Arainami

    Joined:
    Dec 2, 2014
    Posts:
    11
    So 5.4 is already out of beta, and nothing has changed. The bug is still there
     
  13. AllanMSmith

    AllanMSmith

    Joined:
    Oct 2, 2012
    Posts:
    180
    Hm.... apparently even 5.3.3 and 5.3.4 are working alright for whatever the bug was in our project, its solved. Havent tried the 5.4 yet
     
  14. Arainami

    Arainami

    Joined:
    Dec 2, 2014
    Posts:
    11
    And you're still using the option Optimize Game Objects in the inspector? Because we still have a problem if we use this option. We also checked the version 5.3.3 and 5.3.4 - without results
     
  15. Arainami

    Arainami

    Joined:
    Dec 2, 2014
    Posts:
    11
  16. AllanMSmith

    AllanMSmith

    Joined:
    Oct 2, 2012
    Posts:
    180
    Yes, I am using optimize game objects... it did solve the issue for us.