SteinarvDesign Posted November 14, 2021 Share Posted November 14, 2021 I have 2 functions: generateParticles and animateParticles ( w. an inner timeline ). I also have a 'Main Timeline': gsap.timeline( { repeat: -1 } ).call( animateParticles, [numParticles - 1], '-=0' ); The problem is that 'animateParticles' executes only ONE time - the function will NOT repeat. How can I make the function 'animateParticles' repeat itself after the first execution - play multiple times ? See the Pen QWMZxOB by steinarV (@steinarV) on CodePen Link to comment Share on other sites More sharing options...
Solution Cassie Posted November 14, 2021 Solution Share Posted November 14, 2021 Hey there @SteinarvDesign, I may be misunderstanding - so apologies if so - but are you sure you want to call that function multiple times? Maybe an easier way would be to just repeat the timeline created inside that function? let pTimeLine = gsap.timeline({repeat: -1}); Link to comment Share on other sites More sharing options...
SteinarvDesign Posted November 14, 2021 Author Share Posted November 14, 2021 @Cassie Thank you . . . repeating the timeline inside the recursive function is a solution. Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now