Infinite loop detected in a timeline (rehash)

A blueprint usually runs just timelines was occasionally ‘detecting infinite’ loop as originally discussed here.

Turns out the root case was that during the Update of the timeline, occasionally I need to reverse the direction of the timeline. This was done by first stopping the timeline, setting some variables and then either Play or Reverse the same timeline so the animation would run in reverse to what it originally was doing.

If you add a “Delay until next Tick” after stopping the timeline, no more infinite loops are detected. Apparently there was a possible race condition that the delay node works around.

I eventually found this by waiting until the ‘Infinite loop detected’ in the Editor and then pressing Snapshot (lower right of editor window) and then starting Insights and looking at that snapshot. Looking at where the frame rate drops, I saw a series of repeating steps- Play/Ubergraph/multiply repeated a bunch of times. This also shows that when Editor does detect an infinite loop, whatever it says is the problem isn’t necessarily.

Posted above from a different account (apologies). Happy to report no more ‘infinite loop detected’ when using a Delay Until Next Tick node after stoping the timeline and before reversing.

Turns out I also rewrote the blueprint to not to use any timelines. Instead on Event Tick event a boolean is immediately tested. if true, then essentially do what the timeline Update pin did, otherwise return. works better than using timelines, though a bit more manual coding.

In either case, easy to hit the target frame rate with less than 50% gpu or cpu. Oh, Cast Shadow is very expensive in VR- don’t do that unless necessary.

1 Like