Hey Guys!
Faced a problem, I do not know how to solve, please help with advice.
I created animation using scroll trigger and motion path. The idea is to track scrolling using scroll trigger, then object move using motion path and at the end of the path additional animation start to work. Here is the small snippet:
The problem is that when the path ends and the animation starts, it does not start smoothly, but at first with a jerk. Can someone please explain the best practices for tasks like this, thank you very much, have a nice day
const flow1 = gsap.fromTo('#coin', {
y: -181.898 // End of the path coordinate
}, {
y: -212,
yoyoEase: 'sine.inOut',
repeat: -1,
duration: 2.6
})
timeline.to('#coin', {
opacity: 1,
motionPath: {
path: 'M292.801,16.834 C373.005,-181.943 489.752,-167.563 770.258,-181.898'
},
scrollTrigger: {
trigger: '.big-form',
start: 'top top',
end: '+=300',
scrub: 1,
onUpdate: ({ progress }) => (progress === 1
? flow1.play()
: flow1.pause())
}
})