I use an Animator on a GameObject hierarchy with a clip animating the rotation of a child. Everything is fine in the editor (5.3.0.f4). On iOS the animation generates NaN for rotation and scale of that child object so that the attached sprite is not being rendered.
I reduced everything in order to find the bug.The hierarchy is: Root->Body->Head->JawAnimator is attached to Root.The animation clip does only a rotation around the z-axis starting at 20 and going to 10. So nothing special here.
An attached script logs for the Head object:Local Rotation: (NaN, NaN, NaN, NaN)Rotation: (NaN, NaN, NaN, NaN)Local Scale: (1.0, 1.0, 1.0)Scale: (NaN, NaN, NaN)
Only position seems to be fine.
If I don't change any value within the animation (only static values) everything stays fine.
Anyone an idea what I'm doing wrong? Thanks!
Answer by DLBit
Dec 20, 2015 at 11:57 AM
Seems to work if I switch Interpolation from Euler Angles to Quaternion in the animation clip. Is it a bug in the iOS implementation or did I miss something?
Took me a while to figure out how to change the interpolation settings. You have to right-click on the animation properties. This fixed my issue also, for the record, so thanks!
Answer by DLBit
Dec 21, 2015 at 09:38 AM
Problem still exists in 5.3.1f1.
@DLBit, just wanted to say that I'm having the same "problem" ? (I'm new to Unity so I'm not really sure if this is not because of something I'm doing wrong).
I had an older project from a tutorial I followed which had some rotations on sprites which worked as expected. So I checked the interpolation types and the value was set to "Euler Angle (Quaternion Approximation)". In the tutorial it wasn't a step to manually choose this interpolation type so I'm guessing it's the default value that has changed with Unity3D updates.
I set the interpolation to "Euler Angle (Quaternion Approximation)" and now I have the animation working properly on iOS.
Thanks. Glad to see I'm not alone with it. You're right. On iOS, Euler Angle (Quaternion Approximation) works too. Just tried it. So everything works fine except for the default... Maybe I should report it as a bug.
I am also having the same issue on Android devices
This is a really use full information
Changing to Quaternion Approximation worked for me too ...
I also just dealt with this issue. Right now it seems that your solution of changing the Interpolation Mode to Quaternion is the only way to change it.
Also had this issue and your workaround did the trick. Thanks!
Has anyone reported this as a bug?
Yes. It is case 761257.
Up to 2 attachments (including images) can be used with a maximum of 524.3 kB each and 1.0 MB total.
The best place to ask and answer questions about development with Unity.
To help users navigate the site we have posted a site navigation guide.
If you are a new user to Unity Answers, check out our FAQ for more information.
Make sure to check out our Knowledge Base for commonly asked Unity questions.
If you are a moderator, see our Moderator Guidelines page.
We are making improvements to UA, see the list of changes.
Answers and Comments
58 People are following this question.
Animations unwanted movement and rotation after updating
Animation does not move!
PLAYER NOT ACTIVATING TRIGGER WHEN ON TOP OF THE COLLIDER! IS THIS A BUG
Animation Resets Position When Played:
Game-view and run time editor are displaying animation but the projectile is spawned as if AI was in T-pose