Share Posted May 7, 2020 So theres two things I'm trying to accomplish that I can't seem to figure out. How would i go about changing the "baseSpeed" to 0 when I hover over the button and if I wanted the particles to interact with the cursor either repel or attract how should I go about that. See the Pen XWmZQJa by trendstar (@trendstar) on CodePen Link to comment Share on other sites More sharing options...
Share Posted May 7, 2020 1 hour ago, odell said: How would i go about changing the "baseSpeed" to 0 when I hover over the button GSAP animates objects, so you could put the speed in an object and animate that object. Something like: const baseObj = {speed: 0.02}; // Later gsap.to(baseObj, {speed: 0}); 1 hour ago, odell said: if I wanted the particles to interact with the cursor either repel or attract how should I go about that. You need to calculate the distance from the mouse position to each particle and then implement some logic to animate the particle to or away from that point 1 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