Unity 2021.2 ArgumentOutofRangeException Timeline.DiscreeteTime.DoubleToDescreteTime

Hello,

I’m trying to upgrade my timeline heavy project to 2021.2.4 and have been having a lot of various problems.
It unfortunately, only seems to be affecting my project and I can’t reproduce it in a standalone project. So I’m wondering if someone might be able to give me some advice. Submitting my whole project isn’t really an option for NDA reasons so I’m hoping to see if I can get some help or see if other people have had this problem.

The exception I’m encountering is:
ArgumentOutOfRangeException: Specified argument was out of the range of valid values.
Parameter name: Time is over the discrete range.
at UnityEngine.Timeline.DiscreteTime.DoubleToDiscreteTime (System.Double time) [0x00040] in F:\Projects\MyProject\Game\Library\PackageCache\com.unity.timeline@1.6.3\Runtime\DiscreteTime.cs:88
at UnityEngine.Timeline.DiscreteTime.GetNearestTick (System.Double time) [0x00002] in F:\Projects\MyProject\Game\Library\PackageCache\com.unity.timeline@1.6.3\Runtime\DiscreteTime.cs:223
at UnityEngine.Timeline.TimelinePlayable.Evaluate (UnityEngine.Playables.Playable playable, UnityEngine.Playables.FrameData frameData) [0x0003f] in F:\Projects\MyProject\Game\Library\PackageCache\com.unity.timeline@1.6.3\Runtime\TimelinePlayable.cs:261
at UnityEngine.Timeline.TimelinePlayable.PrepareFrame (UnityEngine.Playables.Playable playable, UnityEngine.Playables.FrameData info) [0x00004] in F:\Projects\MyProject\Game\Library\PackageCache\com.unity.timeline@1.6.3\Runtime\TimelinePlayable.cs:249

Unity 2021.2.4
Timeline Package: 1.6.3
Build: Win Standalone IL2CPP (both editor and Mono builds work fine)

This is causing all of my timelines to terminate immediately and be skipped. This appears to be happening for all of my timelines and I’m not sure why. My guess it’s some weird IL2CPP bug with this version of Unity. The last version I was using was 2021.1.4 and the timeline 1.5.6 package. If people have thoughts about what might be causing this exception on existing timelines I’d appreciate it. Thanks!

This indicates that the current time of the Timeline Playable is somehow larger than 9223372036854775807 or smaller than
-9223372036854775808. Most likely, that time is either NaN, -Infinity or Infinity.

If you cannot provide your project in a bug report, then you will need to figure out how that time got passed to the Timeline.

Most likely reason in my opinion is a division by zero.

If you want to diagnose this, you could copy the Timeline package folder (from the package cache) in your /Packages folder, then add debug logs in the methods that are part of the stack.

1 Like

Hi, thank you for spending the time to provide feedback. I forgot to update this, but this actually was caused due to our data being deserialized incorrectly (a separate IL2CPP problem) and us setting an extremely high value for the time value which pushed it to max value.

Great! I am happy you figured it out.