joelreed Posted September 28, 2021 Share Posted September 28, 2021 Hey, new to GSAP so still working it all out. As seen in my codepen, I have boxes flying across the screen which is what I want, but I want each individual box to repeat this animation as soon as it makes it to the end. Currently the code waits for every box to finish before repeating (all the boxes have random duration, so this means currently the faster boxes have to wait for the slower ones to finish before repeat). I'd like every box to just repeat as soon as it finishes its random duration. Any advice on this would be appreciated. Thanks! See the Pen gORqpOK by joelreed (@joelreed) on CodePen Link to comment Share on other sites More sharing options...
Solution PointC Posted September 28, 2021 Solution Share Posted September 28, 2021 Hi @joelreed Welcome to the forum. I'd probably do something like this. See the Pen 505bddb65f7a38b7cf4e482e5b41d709 by PointC (@PointC) on CodePen Happy tweening and welcome aboard. 4 Link to comment Share on other sites More sharing options...
OSUblake Posted September 28, 2021 Share Posted September 28, 2021 For more randomness you can have a function call itself over and over again. See the Pen qBjgdgY by GreenSock (@GreenSock) on CodePen 4 Link to comment Share on other sites More sharing options...
PointC Posted September 28, 2021 Share Posted September 28, 2021 3 Link to comment Share on other sites More sharing options...
joelreed Posted September 29, 2021 Author Share Posted September 29, 2021 Awesome, thanks! These answers are perfect! 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