Dear Zach,
Thank you so much for your fast reply!
Very interesting that you could not recreate the bug. Which browser are you using?
The only thing that makes the bug appear more often/ more reliably for me is really clicking as fast as possible on the hedge and then the "los geht's" / let's go button.
Any idea why the balloon might be jumpy sometimes?
I worked on the code and tried to implement your suggestions. Everything in the github repo as before, now in the commit 24ee231 . Only the changeGaze function changed. Some replies to your notes:
Very interesting! In the beginning, I actually only used .to(). But then I thought the more explicit the better, and that using .to() might be a source of the bug. Apparently, it isn't. So know I switched back to using only .to().
Similar for this point - in the beginning, I put everything in one big timeline with position parameters. For debugging, I created more timelines and couldn't really figure out how to use the position parameters across these timelines anymore. But now back to one timeline and position parameters without delay!
Great tip about the string values! Looks way neater that way!
Yeah, about the RAF... So the problem that I experience is that if I do not set the viewBox (for the balloon) and cx/cy (for the eyes) after animating, they just jump back to their original position. So basically they move to the specified position and once reached, back to the beginning. Obviously, we want to avoid that and want them to stay at their final place. So I thought I just explicitly set the attribute values. If I don't use RAF, you can't see any effect. Same if I call RAF only once. I also just tried to do it with gsap.set() and realized that this method does not exist for the viewBox attribute. Any tips regarding this "setting" problem? You can see the different approaches I tried out in the current version of our minimal demo, in the changeGaze function.
About the positioning being off the screen: that's alright, only a problem in the minimal demo (was too lazy to fix it here ?).
Thanks a lot for taking the time!