Hi, I am a new user of gsap, I just removed the end property and edited the other properties according to my requirements in my next.js project. The above codepen is the same as the documentation example with its end property removed. I am facing the same problem as that codepen, sometimes the car or tractor goes out of the screen while scrolling, I noticed the further the end, the slower the car moves and vice-versa. Could someone please suggest what I should do to fix this, I tried modifying start and end properties but that becomes unresponsive on different sizes.
In simple words it is not responsive for all sizes.
In my next.js project this is the code for the animation
gsap.to("#motionSVG", {
scrollTrigger: {
trigger: ".section.hiw",
start: "300px 20% ",
scrub: 1,
markers: true,
onUpdate: (self) => {
gsap.to("#tractor", {
rotation: () => (self.direction === 1 ? 0 : -180),
overwrite: "auto",
});
},
},
duration: 10,
ease: "none",
immediateRender: true,
motionPath: {
path: "#motionPath",
align: "#motionPath",
alignOrigin: [0.5, 0.5],
autoRotate: 90,
},
});