Jump to content
Search Community

tween using speed instead of duration

Jack_a test
Moderator Tag

Recommended Posts

I am using TweenMax to move a div to a certain x position,  with the x position getting updated at certain points. I want to achieve an infinite animation in a specific direction with a constant speed, preferably without using repeat because that causes other issues for me. If I use duration, the animation speed changes when the distance changes, so I tried accounting for it with timeScale(). I was able to regulate the speed like this but eventually tween.time() becomes equal to tween.duration() and the animation stops. I tried updating the duration mid tween every time I updated my x value, but the result was weird. Is there way to achieve what I want?

 

EDIT:

 

this solution wouldn't work anyways after some testing. Thank you for considering my issue anyways.

Edited by Jack_a
solved
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...