• Unity
  • ArithmeticException: NAN when timeScale is 0.

Exception happens when timeScale value is 0.

Stacktrace:

.ArithmeticException: NAN
System.Math.Sign (Single value) (at /Users/builduser/buildslave/mono/build/mcs/class/corlib/System/Math.cs:485)
Spine.AnimationState.ApplyRotateTimeline (Spine.RotateTimeline rotateTimeline, Spine.Skeleton skeleton, Single time, Single alpha, Boolean setupPose, System.Single[] timelinesRotation, Int32 i, Boolean firstFrame) (at Assets/Standard Assets/spine-csharp/AnimationState.cs:298)
Spine.AnimationState.ApplyMixingFrom (Spine.TrackEntry entry, Spine.Skeleton skeleton) (at Assets/Standard Assets/spine-csharp/AnimationState.cs:229)
Spine.AnimationState.Apply (Spine.Skeleton skeleton) (at Assets/Standard Assets/spine-csharp/AnimationState.cs:163)
Spine.Unity.SkeletonAnimation.Update (Single deltaTime) (at Assets/Standard Assets/spine-unity/SkeletonAnimation.cs:177)
Spine.Unity.SkeletonAnimation.Update () (at Assets/Standard Assets/spine-unity/SkeletonAnimation.cs:167)

There was no problem before 3.5 runtime.
After applying 3.5 runtime, exception appeared.
Please fix.

Related Discussions
...
  • Изменено

I can't seem to replicate the bug.
Do you have steps?

I can't imagine where the NaN would come from but just setting or moving timeScale to 0 isn't causing it on my end.

Yea we use 0 timescale for dev testing and I can't repro it either.. I assume you updated unity to latest runtimes? When I "update" i just wipe all existence of Spine from my assets folder ;P

One more exception. same kind, different position.

Stacktrace:

ArithmeticException: NAN
System.Math.Sign (Single value) (at /Users/builduser/buildslave/mono/build/mcs/class/corlib/System/Math.cs:485)
Spine.ScaleTimeline.Apply (Spine.Skeleton skeleton, Single lastTime, Single time, Spine.ExposedList`1 firedEvents, Single alpha, Boolean setupPose, Boolean mixingOut) (at Assets/Standard Assets/spine-csharp/Animation.cs:398)
Spine.AnimationState.ApplyMixingFrom (Spine.TrackEntry entry, Spine.Skeleton skeleton) (at Assets/Standard Assets/spine-csharp/AnimationState.cs:235)
Spine.AnimationState.Apply (Spine.Skeleton skeleton) (at Assets/Standard Assets/spine-csharp/AnimationState.cs:163)
Spine.Unity.SkeletonAnimation.Update (Single deltaTime) (at Assets/Standard Assets/spine-unity/SkeletonAnimation.cs:177)
Spine.Unity.SkeletonAnimation.Update () (at Assets/Standard Assets/spine-unity/SkeletonAnimation.cs:167)

This exception happens quite often. but not always.
I am investigating repoduction step.
If I change timeScale to non-zero value, exception disappeared.

When I "update" i just wipe all existence of Spine from my assets folder ;P

And I also wiped.


29 Nov 2016, 16:21


This bug related with data.

In first case, r1 is NaN in ApplyRotateTimeline()

ArithmeticException: NAN
System.Math.Sign (Single value) (at /Users/builduser/buildslave/mono/build/mcs/class/corlib/System/Math.cs:485)
Spine.AnimationState.ApplyRotateTimeline (Spine.RotateTimeline rotateTimeline, Spine.Skeleton skeleton, Single time, Single alpha, Boolean setupPose, System.Single[] timelinesRotation, Int32 i, Boolean firstFrame) (at Assets/Standard Assets/spine-csharp/AnimationState.cs:298)
Spine.AnimationState.ApplyMixingFrom (Spine.TrackEntry entry, Spine.Skeleton skeleton) (at Assets/Standard Assets/spine-csharp/AnimationState.cs:229)
Spine.AnimationState.Apply (Spine.Skeleton skeleton) (at Assets/Standard Assets/spine-csharp/AnimationState.cs:163)
Spine.Unity.SkeletonAnimation.Update (Single deltaTime) (at Assets/Standard Assets/spine-unity/SkeletonAnimation.cs:177)
Spine.Unity.SkeletonAnimation.Update () (at Assets/Standard Assets/spine-unity/SkeletonAnimation.cs:167)

In second case, bx is NaN in Apply()

ArithmeticException: NAN
System.Math.Sign (Single value) (at /Users/builduser/buildslave/mono/build/mcs/class/corlib/System/Math.cs:485)
Spine.ScaleTimeline.Apply (Spine.Skeleton skeleton, Single lastTime, Single time, Spine.ExposedList`1 firedEvents, Single alpha, Boolean setupPose, Boolean mixingOut) (at Assets/Standard Assets/spine-csharp/Animation.cs:398)
Spine.AnimationState.ApplyMixingFrom (Spine.TrackEntry entry, Spine.Skeleton skeleton) (at Assets/Standard Assets/spine-csharp/AnimationState.cs:235)
Spine.AnimationState.Apply (Spine.Skeleton skeleton) (at Assets/Standard Assets/spine-csharp/AnimationState.cs:163)
Spine.Unity.SkeletonAnimation.Update (Single deltaTime) (at Assets/Standard Assets/spine-unity/SkeletonAnimation.cs:177)
Spine.Unity.SkeletonAnimation.Update () (at Assets/Standard Assets/spine-unity/SkeletonAnimation.cs:167)

All of our data are re-exported after updating to 3.5.
Maybe not runtime bug but spine editor bug.

Have you tried reexporting? There was a problem with exports from 3.5.34 yesterday.

Re-exported with 3.5.40 and tested.
Still have same problem.

Can you share your project/assets with us so we can take a look at it? You can send it to contact@esotericsoftware.com

5 дней спустя

There are no problems with latest updated runtime.
Thank you.

Glad to hear it! Thanks for telling us.

4 месяца спустя

Getting this problem now with the March build. Am pausing the game, and as paused is fine, but when returning to normal time it errors.

ArithmeticException: NAN
System.Math.Sign (Single value) (at /Users/builduser/buildslave/mono/build/mcs/class/corlib/System/Math.cs:485)
Spine.AnimationState.ApplyRotateTimeline (Spine.RotateTimeline rotateTimeline, Spine.Skeleton skeleton, Single time, Single alpha, Boolean setupPose, System.Single[] timelinesRotation, Int32 i, Boolean firstFrame) (at Assets/spine-csharp/AnimationState.cs:306)
Spine.AnimationState.Apply (Spine.Skeleton skeleton) (at Assets/spine-csharp/AnimationState.cs:181)
Spine.Unity.SkeletonAnimation.Update (Single deltaTime) (at Assets/spine-unity/SkeletonAnimation.cs:177)
Spine.Unity.SkeletonAnimation.Update () (at Assets/spine-unity/SkeletonAnimation.cs:167)
4 дня спустя

Can you send your relevant assets to unity@esotericsoftware.com and how to reproduce the problem?
We haven't been seeing this in our tests and from other users' assets.