Hello !
After a lot of time using GSAP I don't really understand why this is happening. It is a very simple use case.
First I create the Master timeline that is fired by ScrollTrigger
this.master = new GSAP.timeline({
scrollTrigger: {
trigger: ".scroll-controls",
start: "top top",
end: "bottom bottom",
scrub: 1,
immediateRender: false,
},
});
then I add some tweens and finally I build the master timeline
cuadro0() {
let tl = new GSAP.timeline({ immediateRender: false, });
tl.fromTo(this.camera.position, { x: -5.9 }, { x: -4.1, z: 4.7 }).to(
this.camera.rotation,
{
y: -3,
}
);
return tl;
}
buildMaster() {
this.master.add(this.pasillo0());
this.master.add(this.cuadro0());
}
The expected behaviour is to wait to reach the ScrollTrigger section to play the timeline but the reality is that everything is played on page load...
what is happening?
I tried many approach like pausing it, disabling it... but no way ?