Hey, everybody. I've been working with GreenSock for several months and have had great experiences, but today I'm stuck on a problem that I just can't puzzle out.
My latest animation works erratically. Sometimes it runs perfectly, but more often it halts silently on the first frame.
There are no error messages in the console to indicate a problem.
If I instantiate GSDevTools for my animation timeline, it shows the Global Timeline instead (as a 1000-second timeline that continues to run, but without anything actually happening in my animation.) (When the animation works correctly, as it does occasionally, GSDevTools shows the animation-specific timeline as it's supposed to.)
If I restart the animation timeline from the console, the animation will continue and play out normally. (This is specific to the timeline I assigned this animation to. Restarting the global timeline has no effect.)
This animation is launched on arrival on the site, so it occurred to me that maybe there's some kind of race condition where something hasn't finished loading yet, although I don't know what it would be or why there wouldn't be a relevant error. I tried introducing a two-second delay before starting the animation, and that improved the success rate by a lot - but it still fails occasionally, and I'd really like to find the actual problem rather than work around it with an artificial delay.
If you would like to see the animation, you can view an earlier, mostly-working version here: https://globalroboticslab.com
At this link, the animation will run twice the first time you load the site. That has to do with a "letter" that is shown the first time you visit the site. Once you dismiss the letter, it sets a cookie which prevents the letter from being shown again, so if you dismiss the letter and reload the page everything should work properly. (This is one of the issues I was trying to resolve with this rewrite, and is part of why I'm not simply going back to the way things were in the previous draft.)
The broken development version is here: https://globalroboticslab.com/review/
A number of changes have been made to the code at that second link, including some changes to the way the animation is launched, but I can't see anything that seems like it would be relevant. (I've also commented out a whole bunch of code in order to simplify the way the animation is launched, in the hopes of isolating the problem, but without success.) If the animation halts on the first frame (as it usually does), you can enter "zwlt.restart()" in the console to start it up again.
This link will instantiate GSDevTools and also run the animation timeline at half-speed: https://globalroboticslab.com/review/index.html?animationtimescale=2
For convenience, in case anyone wants to look at the code, I moved all the obviously relevant pieces to the end or almost to the end of /review/index.html and /review/main.js. The timeline for this animation is named "zwlt" and most of the timeline instructions are in the function named "startZWelcome()" near the bottom of /review/main.js.
Any suggestions would be appreciated. I'll watch this thread and respond if anyone offers ideas or has follow-up questions. Thanks to all in advance.