Jump to content
Search Community

Particles, nested timeline, repeat problem

SteinarvDesign
Moderator Tag

Go to solution Solved by Cassie,

Recommended Posts

SteinarvDesign
Posted

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.

  • Solution
Posted

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});

 

SteinarvDesign
Posted

@Cassie

 

Thank you . . . repeating the timeline inside the recursive function is a solution.

 

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 account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...