Jump to content
Search Community

How do I add static motion to this animation?

delux test
Moderator Tag

Recommended Posts

Hello!

I have an animation of flying elements on gsap - the elements move slightly when the cursor moves, please tell me how to make these elements move (a little slower) even if you do not move the cursor?

That is, the page loaded, and the elements began to float slightly .. moved the cursor - they move a little faster - is that possible?

See the Pen eYJagvz by Alexandr (@Alexandr) on CodePen

Link to comment
Share on other sites

11 minutes ago, mikel said:

Hey @delux,

 

Do you mean such a constellation?

 

 

 

 

Happy tweening ...

Mikel

 

Thank you very much for responding

This is roughly what I need, but how can I connect this to my script?

For me, the elements react to the movement of the cursor (

Link to comment
Share on other sites

Hey delux. The trick to having two animations affecting the same properties of the same element is to not affect the same element. Instead, create a container around the element and animate that with one animation and animate the element itself with the other animation.

 

There are a lot of ways to set that up though. Here's one way:

See the Pen qBbGprL?editors=0010 by GreenSock (@GreenSock) on CodePen

 

Side note: Please use the "fork" button on CodePen when making changes to respond in the forum so that the old context is not lost and future readers can see the whole picture :) 

  • Like 3
Link to comment
Share on other sites

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...