You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
NullReferenceException: Object reference not set to an instance of an object.
at Animancer.AnimancerState.IsPlayingAndNotEnding () [0x00000] in <00000000000000000000000000000000>:0
at Cysharp.Threading.Tasks.EnumeratorAsyncExtensions+EnumeratorPromise+<ConsumeEnumerator>d__19.MoveNext () [0x00000] in <00000000000000000000000000000000>:0
at Cysharp.Threading.Tasks.EnumeratorAsyncExtensions+EnumeratorPromise.MoveNext () [0x00000] in <00000000000000000000000000000000>:0
at Cysharp.Threading.Tasks.Internal.PlayerLoopRunner.RunCore () [0x00000] in <00000000000000000000000000000000>:0
at UnityEngine.LowLevel.PlayerLoopSystem+UpdateFunction.Invoke () [0x00000] in <00000000000000000000000000000000>:0
--- End of stack trace from previous location where exception was thrown ---
at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw () [0x00000] in <00000000000000000000000000000000>:0
at Cysharp.Threading.Tasks.CompilerServices.AsyncUniTask`1+<>c[TStateMachine].<.cctor>b__12_0 () [0<…>
The exception only appears on device, not on Editor. But on editor we noticed that if we await a Play(clip) on the same frame where we destroy the GameObject of the clip, the AnimancerState.IsPlayingAndNotEnding always returns true (which produce a "Task" leak).
Reproduction
I don't have an example scene to replicate the problem. But something similar to this would generate the problem:
Environment
Description
The exception only appears on device, not on Editor. But on editor we noticed that if we
await
aPlay(clip)
on the same frame where we destroy theGameObject
of the clip, theAnimancerState.IsPlayingAndNotEnding
always returns true (which produce a "Task" leak).Reproduction
I don't have an example scene to replicate the problem. But something similar to this would generate the problem:
Now destroying the object will cause a Task leak and "[Animancer] Animation out END" message never appears in the console.
Solution
At
AnimancerState.IsPlayingAndNotEnding
method add this early condition exitThe text was updated successfully, but these errors were encountered: