Jump to content
GreenSock

pdiddles03

Distance or velocity while Tweening

Warning: Please note

This thread was started before GSAP 3 was released. Some information, especially the syntax, may be out of date for GSAP 3. Please see the GSAP 3 migration guide and release notes for more information about how to update the code to GSAP 3's syntax. 

Recommended Posts

if I am tweening a object in a game i am  making, i need it's velocity. Is there a way to throw this property so i can use it?  

 

So lets say i want to jump .

TweenMax.to(player, 1, {y:player.y-100})

is there any possible way to get the  distance that was traveled from one spot to another? Another way i can explain it is if i push the right or left arrow, i change the x velocity of the object to "player.vx = 5",  so it's velocity is 5.  

Link to comment
Share on other sites

Hello pdiddles03, and welcome to the GreenSock Forum!

 

If you could please setup a limited codepen example so we can see your code in context. And then we can test the code live.

 

 

Thanks :)

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